diff --git a/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md b/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md index 3fcdb4bbe2..83ae1f9a4b 100644 --- a/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md +++ b/src/ch07-04-bringing-paths-into-scope-with-the-use-keyword.md @@ -41,10 +41,9 @@ root, `hosting` is now a valid name in that scope, just as though the `hosting` module had been defined in the crate root. Paths brought into scope with `use` also check privacy, like any other paths. -Specifying a relative path with `use` is slightly different. Instead of -starting from a name in the current scope, we must start the path given to -`use` with the keyword `self`. Listing 7-12 shows how to specify a relative -path to get the same behavior as in Listing 7-11. +You can also bring an item into scope with `use` and a relative path. Listing +7-12 shows how to specify a relative path to get the same behavior as in +Listing 7-11. Filename: src/lib.rs @@ -55,7 +54,7 @@ mod front_of_house { } } -use self::front_of_house::hosting; +use front_of_house::hosting; pub fn eat_at_restaurant() { hosting::add_to_waitlist(); @@ -66,10 +65,7 @@ pub fn eat_at_restaurant() { ``` Listing 7-12: Bringing a module into scope with `use` and -a relative path starting with `self` - -Note that using `self` in this way might not be necessary in the future; it’s -an inconsistency in the language that Rust developers are working to eliminate. +a relative path ### Creating Idiomatic `use` Paths