turns out that one *can* use 'extern crate' in submodules
[rust-101.git] / workspace / src / part13.rs
index 88d1ea6f7755d40efc96940c72174cc0b5622028..2be43536e20a4b299e019bb409bbbdadb5c905b9 100644 (file)
@@ -45,13 +45,13 @@ fn sort_array() {
 // ## External Dependencies
 
 
-// I disabled the following module (using a rather bad hack), because it only compiles if `docopt` is linked. However, before enabling it,
-// you still have get the external library into the global namespace. This is done with `extern crate docopt`, and that statement *has* to be
-// in `main.rs`. So please go there, and enable this commented-out line. Then remove the attribute of the `rgrep` module.
+// I disabled the following module (using a rather bad hack), because it only compiles if `docopt` is linked.
+// Remove the attribute of the `rgrep` module to enable compilation.
 #[cfg(feature = "disabled")]
 pub mod rgrep {
-    // Now that `docopt` is linked and declared in `main.rs`, we can import it with `use`. We also import some other pieces that we will need.
-    use docopt::Docopt;
+    // Now that `docopt` is linked, we can first root it in the namespace and then import it with `use`. We also import some other pieces that we will need.
+    extern crate docopt;
+    use self::docopt::Docopt;
     use part12::{run, Options, OutputMode};
     use std::process;