Skip to content

Commit d3ebc3d

Browse files
committed
02_basic_calculator/10_as_casting
1 parent 6c292cd commit d3ebc3d

File tree

1 file changed

+3
-3
lines changed
  • exercises/02_basic_calculator/10_as_casting/src

1 file changed

+3
-3
lines changed

exercises/02_basic_calculator/10_as_casting/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ mod tests {
66

77
#[test]
88
fn u16_to_u32() {
9-
let v: u32 = todo!();
9+
let v: u32 = 47u16 as _;
1010
assert_eq!(47u16 as u32, v);
1111
}
1212

@@ -24,14 +24,14 @@ mod tests {
2424
// You could solve this by using exactly the same expression as above,
2525
// but that would defeat the purpose of the exercise. Instead, use a genuine
2626
// `i8` value that is equivalent to `255` when converted to `u8`.
27-
let y: i8 = todo!();
27+
let y: i8 = -1;
2828

2929
assert_eq!(x, y);
3030
}
3131

3232
#[test]
3333
fn bool_to_u8() {
34-
let v: u8 = todo!();
34+
let v: u8 = true as _;
3535
assert_eq!(true as u8, v);
3636
}
3737
}

0 commit comments

Comments
 (0)