summaryrefslogtreecommitdiff
path: root/rustlings/exercises/07_structs/structs3.rs
diff options
context:
space:
mode:
authorHunter Kvalevog <hunter@kvog.sh>2026-09-19 17:44:02 -0500
committerHunter Kvalevog <hunter@kvog.sh>2026-09-19 17:44:02 -0500
commit13c7b05a26b78cb63bed5d2afdf8eb927197286e (patch)
tree29ae22718398ef3c1d605ea8725ebbac9c8b4ac3 /rustlings/exercises/07_structs/structs3.rs
parent4791a7ab0400713568f8c9594d9ac2bac10cd8ae (diff)
rustlings: complete 07
Diffstat (limited to 'rustlings/exercises/07_structs/structs3.rs')
-rw-r--r--rustlings/exercises/07_structs/structs3.rs11
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
}
}