We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e6ed27b + 95c7f30 commit 10387d6Copy full SHA for 10387d6
src/doc/trpl/crates-and-modules.md
@@ -355,6 +355,10 @@ Hello in English: Hello!
355
Goodbye in English: Goodbye.
356
```
357
358
+`pub` also applies to `struct`s and their member fields. In keeping with Rust’s
359
+tendency toward safety, simply making a `struct` public won't automatically
360
+make its members public: you must mark the fields individually with `pub`.
361
+
362
Now that our functions are public, we can use them. Great! However, typing out
363
`phrases::english::greetings::hello()` is very long and repetitive. Rust has
364
another keyword for importing names into the current scope, so that you can
0 commit comments