Make users type method syntax themselves in structs3

closes #2286
This commit is contained in:
Remo Senekowitsch
2026-04-05 22:23:47 +02:00
parent 7150a9eb79
commit 7c1d8ebf49
4 changed files with 69 additions and 129 deletions
+4 -5
View File
@@ -417,11 +417,10 @@ https://doc.rust-lang.org/book/ch05-01-defining-structs.html#creating-instances-
name = "structs3"
dir = "07_structs"
hint = """
For `is_international`: What makes a package international? Seems related to
the places it goes through right?
For `get_fees`: This method takes an additional argument, is there a field in
the `Package` struct that this relates to?
Methods and associated functions are both declared in an `impl MyType {}`
block. Methods have a `self`, `&self` or `&mut self` parameter, where `self`
implicitly has the type of the impl block. Associated functions do not have
a `self` parameter.
Have a look in The Book to find out more about method implementations:
https://doc.rust-lang.org/book/ch05-03-method-syntax.html"""