This repository has been archived on 2025-11-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
rustex/exercises/02_basic_calculator/01_integers/src/lib.rs
2025-02-19 15:50:18 +05:30

16 lines
307 B
Rust

fn compute(a: u32, b: u32) -> u32 {
// TODO: change the line below to fix the compiler error and make the tests pass.
let multiplier: u8 = 4;
a + b * multiplier as u32
}
#[cfg(test)]
mod tests {
use crate::compute;
#[test]
fn case() {
assert_eq!(compute(1, 2), 9);
}
}