From 13c7b05a26b78cb63bed5d2afdf8eb927197286e Mon Sep 17 00:00:00 2001 From: Hunter Kvalevog Date: Sat, 19 Sep 2026 17:44:02 -0500 Subject: rustlings: complete 07 --- rustlings/exercises/07_structs/structs3.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'rustlings/exercises/07_structs/structs3.rs') diff --git a/rustlings/exercises/07_structs/structs3.rs b/rustlings/exercises/07_structs/structs3.rs index 69e5ced..d24da27 100644 --- a/rustlings/exercises/07_structs/structs3.rs +++ b/rustlings/exercises/07_structs/structs3.rs @@ -23,15 +23,12 @@ impl Package { } } - // TODO: Add the correct return type to the function signature. - fn is_international(&self) { - // TODO: Read the tests that use this method to find out when a package - // is considered international. + fn is_international(&self) -> bool { + self.sender_country != self.recipient_country } - // TODO: Add the correct return type to the function signature. - fn get_fees(&self, cents_per_gram: u32) { - // TODO: Calculate the package's fees. + fn get_fees(&self, cents_per_gram: u32) -> u32 { + self.weight_in_grams * cents_per_gram } } -- cgit v1.2.3