diff --git a/src/main.rs b/src/main.rs index 40283d6..30a4bc8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,7 +48,7 @@ impl TryFrom for MyType2Val { match value { 0x1 => Ok(MyType2Val::A), 0x2 => Ok(MyType2Val::B), - _ => panic!() + _ => panic!(), } } } @@ -65,7 +65,11 @@ impl MyTrait for MyType2 { fn main() { println!("Hello, world!"); - + let x = MyType1 {}; println!("{}", x.converted()); + + let y = MyType2Val::A; + let _y = >::try_into(y).unwrap(); + let _y = >::into(y); }