done with basic calc

This commit is contained in:
2025-02-20 09:59:05 +05:30
parent 57475122a9
commit 7910a25928
9 changed files with 49 additions and 14 deletions

View File

@@ -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 to `u8`.
let y: i8 = todo!();
let y: i8 = 255 as _;
assert_eq!(x, y);
}
#[test]
fn bool_to_u8() {
let v: u8 = todo!();
let v: u8 = 1 as _;
assert_eq!(true as u8, v);
}
}