We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
pub
1 parent e333e6a commit 95c7f30Copy full SHA for 95c7f30
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