From 456fabc992f2a3f9be584c7832a0c21f37ca74a2 Mon Sep 17 00:00:00 2001 From: static Date: Thu, 3 Oct 2024 14:27:06 +0000 Subject: [PATCH] Assignment 1 Done --- src/assignments/assignment01/small_exercises.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assignments/assignment01/small_exercises.rs b/src/assignments/assignment01/small_exercises.rs index 0095978..c636ebe 100644 --- a/src/assignments/assignment01/small_exercises.rs +++ b/src/assignments/assignment01/small_exercises.rs @@ -8,10 +8,10 @@ /// Adds two unsigned words. If overflow happens, just wrap around. pub fn add(lhs: usize, rhs: usize) -> usize { - todo!() + lhs.wrapping_add(rhs) } /// Subtracts two unsigned words. If overflow happens, just wrap around. pub fn sub(lhs: usize, rhs: usize) -> usize { - todo!() + lhs.wrapping_sub(rhs) }