-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
- I have searched open and closed issues and pull requests for duplicates, using these search terms:
- is:issue is:open is:closed re-exporting
- is:issue is:open is:closed re-exporting Names
- is:issue is:open is:closed re-exporting pub use
-
I have checked the latest
main
branch to see if this has already been fixed, in this file:
URL to the section(s) of the book with this problem:
https://doc.rust-lang.org/book/ch07-04-bringing-paths-into-scope-with-the-use-keyword.html
Description of the problem:
The text is a little confusing and could be made more clear.
The text states, "When we bring a name into scope with the use keyword, the name available in the new scope is private. To enable the code that calls our code to refer to that name as if it had been defined in that code's scope, we can combine pub and use."
Suggested fix:
It might be more clear written as "When we bring a name into scope with the use keyword, the name available in that scope is available to be used, while the name is private in any other scope. To enable our external code, found in another scope, to refer to that name as if it had been defined in that code's scope, we can combine pub and use."
The part that is confusing is "To enable the code that calls our code..", and later refer to 'code that calls our code' as external code. It might be more clear to use 'external code' consistently throughout the explanation.