From dfcb9736b2b5476a2c576c712fa0a8d299f75f0e Mon Sep 17 00:00:00 2001 From: david Date: Mon, 17 Jun 2024 11:31:06 +0200 Subject: [PATCH] solution to exercise 02_10 --- exercises/02_basic_calculator/10_as_casting/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/02_basic_calculator/10_as_casting/src/lib.rs b/exercises/02_basic_calculator/10_as_casting/src/lib.rs index b1921d0..60b01aa 100644 --- a/exercises/02_basic_calculator/10_as_casting/src/lib.rs +++ b/exercises/02_basic_calculator/10_as_casting/src/lib.rs @@ -6,7 +6,7 @@ mod tests { #[test] fn u16_to_u32() { - let v: u32 = todo!(); + let v: u32 = 47; assert_eq!(47u16 as u32, v); } @@ -24,14 +24,14 @@ mod tests { // You could solve this by using exactly the same expression as above, // but that would defeat the purpose of the exercise. Instead, use a genuine // `i8` value that is equivalent to `255` when converted from `u8`. - let y: i8 = todo!(); + let y: i8 = -1; assert_eq!(x, y); } #[test] fn bool_to_u8() { - let v: u8 = todo!(); + let v: u8 = 1; assert_eq!(true as u8, v); } }