We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c292cd commit d3ebc3dCopy full SHA for d3ebc3d
exercises/02_basic_calculator/10_as_casting/src/lib.rs
@@ -6,7 +6,7 @@ mod tests {
6
7
#[test]
8
fn u16_to_u32() {
9
- let v: u32 = todo!();
+ let v: u32 = 47u16 as _;
10
assert_eq!(47u16 as u32, v);
11
}
12
@@ -24,14 +24,14 @@ mod tests {
24
// You could solve this by using exactly the same expression as above,
25
// but that would defeat the purpose of the exercise. Instead, use a genuine
26
// `i8` value that is equivalent to `255` when converted to `u8`.
27
- let y: i8 = todo!();
+ let y: i8 = -1;
28
29
assert_eq!(x, y);
30
31
32
33
fn bool_to_u8() {
34
- let v: u8 = todo!();
+ let v: u8 = true as _;
35
assert_eq!(true as u8, v);
36
37
0 commit comments