diff options
| author | Hunter Kvalevog <hunter@kvog.sh> | 2026-09-19 17:44:02 -0500 |
|---|---|---|
| committer | Hunter Kvalevog <hunter@kvog.sh> | 2026-09-19 17:44:02 -0500 |
| commit | 22de341ae6ce69732e38f1fccb22d928f1d6b887 (patch) | |
| tree | 29ae22718398ef3c1d605ea8725ebbac9c8b4ac3 /rustlings/exercises/07_structs/structs3.rs | |
| parent | e24bc063bf60ae9631d631dbad7917c457eaac07 (diff) | |
| download | demos-22de341ae6ce69732e38f1fccb22d928f1d6b887.tar.gz demos-22de341ae6ce69732e38f1fccb22d928f1d6b887.zip | |
Diffstat (limited to 'rustlings/exercises/07_structs/structs3.rs')
| -rw-r--r-- | rustlings/exercises/07_structs/structs3.rs | 11 |
1 files changed, 4 insertions, 7 deletions
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 } } |
