-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
In the version 1.0.0
of the book, the example for the pub use
keyword is more self-explanatory than in the current one because it demonstrates how exactly pub use
works (instead of calling languages::japanese::greetings::hello
we can simply do languages::japanese::hello
if we include pub use self::greetings
in the languages::japanese
module). The current version only slightly mentions its behavior:
By using pub use, external code can now call the add_to_waitlist function using hosting::add_to_waitlist. If we hadn’t specified pub use, the eat_at_restaurant function could call hosting::add_to_waitlist in its scope, but external code couldn’t take advantage of this new path.
An example showing how it would be called in an external module similar to the version 1.0.0 would be much helpful to understand the concept of re-export.