X-Git-Url: https://git.ralfj.de/rust-101.git/blobdiff_plain/0223210576f27d0743c2d12b890d30f5c2ef6b2d..98dafe0138b8bf6584b8d9e86a74a580bb034a26:/src/part13.rs diff --git a/src/part13.rs b/src/part13.rs index d6483d4..29647ea 100644 --- a/src/part13.rs +++ b/src/part13.rs @@ -87,13 +87,13 @@ fn sort_array() { //@ Note that crates.io is only the default location for dependencies, you can also give it the URL of a git repository or some local //@ path. All of this is explained in the [Cargo Guide](http://doc.crates.io/guide.html). -// 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;