Files
100-exercises-to-learn-rust/exercises/04_traits/08_from/src/lib.rs
LukeMathWalker d9a0c025e9 Fix instructions.
2024-05-14 10:02:29 +02:00

11 lines
229 B
Rust

// TODO: Implement the `From` trait for the `u32` type to make `example` compile.
pub struct WrappingU32 {
value: u32,
}
fn example() {
let wrapping: WrappingU32 = 42.into();
let wrapping = WrappingU32::from(42);
}