Assignment 1 Done

This commit is contained in:
static
2024-10-03 14:27:06 +00:00
parent 8bfbd8f90e
commit 456fabc992

View File

@@ -8,10 +8,10 @@
/// Adds two unsigned words. If overflow happens, just wrap around. /// Adds two unsigned words. If overflow happens, just wrap around.
pub fn add(lhs: usize, rhs: usize) -> usize { pub fn add(lhs: usize, rhs: usize) -> usize {
todo!() lhs.wrapping_add(rhs)
} }
/// Subtracts two unsigned words. If overflow happens, just wrap around. /// Subtracts two unsigned words. If overflow happens, just wrap around.
pub fn sub(lhs: usize, rhs: usize) -> usize { pub fn sub(lhs: usize, rhs: usize) -> usize {
todo!() lhs.wrapping_sub(rhs)
} }