Intermediate Rust
Q49 / 100

What is the From/Into trait?

Correct! Well done.

Incorrect.

The correct answer is B) Conversion traits: From<T> for infallible conversions; Into<T> is the reciprocal (implementing From auto-implements Into)

B

Correct Answer

Conversion traits: From<T> for infallible conversions; Into<T> is the reciprocal (implementing From auto-implements Into)

Explanation

impl From<i32> for MyType { fn from(x: i32) -> Self { ... } } then i32::from(x) or x.into() both work.

Progress
49/100