100 exercises to learn Rust

This commit is contained in:
LukeMathWalker
2024-05-12 22:21:03 +02:00
commit 5edebf6cf2
309 changed files with 13173 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
/// Return `true` if `n` is even, `false` otherwise.
fn is_even(n: u32) -> bool {
todo!()
}
#[cfg(test)]
mod tests {
use crate::is_even;
#[test]
fn one() {
assert!(!is_even(1));
}
#[test]
fn two() {
assert!(is_even(2));
}
#[test]
fn high() {
assert!(!is_even(231));
}
}