From 33943ea70c61a63f6f81edd5bb7eedbe7cb8698b Mon Sep 17 00:00:00 2001 From: "Carol (Nichols || Goulding)" Date: Tue, 30 Aug 2016 12:49:43 -0400 Subject: [PATCH] Don't leave the reader hanging wondering about `use` statements And what they're relative to, if not the current module. Fixes #239. --- src/ch07-03-importing-names-with-use.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ch07-03-importing-names-with-use.md b/src/ch07-03-importing-names-with-use.md index 0d1271f92..644264b71 100644 --- a/src/ch07-03-importing-names-with-use.md +++ b/src/ch07-03-importing-names-with-use.md @@ -158,8 +158,9 @@ explanation Why doesn't this work? It's not because we don't have `communicator::` in front of the function like we had in `src/main.rs`: we are definitely within the `communicator` library crate here. The reason is that paths anywhere except in -a `use` statement are relative to the current module. Our `tests` module -doesn't have a `client` module in its scope! +a `use` statement are relative to the current module (In a `use` statement, +they're relative to the crate root by default). Our `tests` module doesn't have +a `client` module in its scope! So how do we get back up one module? We can either use leading colons to say that we want to start from the root and list the whole path: