Don't leave the reader hanging wondering about use statements

And what they're relative to, if not the current module.

Fixes #239.
This commit is contained in:
Carol (Nichols || Goulding)
2016-08-30 12:49:43 -04:00
parent cf3f9e13f1
commit 33943ea70c
+3 -2
View File
@@ -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: