diff --git a/src/book/mod.rs b/src/book/mod.rs index 3b25c68e..5453a2b4 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -68,7 +68,7 @@ impl MDBook { config.update_from_env(); - if log_enabled!(::log::Level::Trace) { + if log_enabled!(log::Level::Trace) { for line in format!("Config: {:#?}", config).lines() { trace!("{}", line); } diff --git a/src/cmd/clean.rs b/src/cmd/clean.rs index 420037d7..07c2fbc6 100644 --- a/src/cmd/clean.rs +++ b/src/cmd/clean.rs @@ -21,7 +21,7 @@ pub fn make_subcommand<'a, 'b>() -> App<'a, 'b> { } // Clean command implementation -pub fn execute(args: &ArgMatches) -> ::mdbook::errors::Result<()> { +pub fn execute(args: &ArgMatches) -> mdbook::errors::Result<()> { let book_dir = get_book_dir(args); let book = MDBook::load(&book_dir)?; diff --git a/src/cmd/watch.rs b/src/cmd/watch.rs index aa1594fa..bf903f90 100644 --- a/src/cmd/watch.rs +++ b/src/cmd/watch.rs @@ -63,14 +63,14 @@ where Ok(w) => w, Err(e) => { error!("Error while trying to watch the files:\n\n\t{:?}", e); - ::std::process::exit(1) + std::process::exit(1) } }; // Add the source directory to the watcher if let Err(e) = watcher.watch(book.source_dir(), Recursive) { error!("Error while watching {:?}:\n {:?}", book.source_dir(), e); - ::std::process::exit(1); + std::process::exit(1); }; let _ = watcher.watch(book.theme_dir(), Recursive); diff --git a/src/config.rs b/src/config.rs index b3707d8e..ae15b29b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -268,7 +268,7 @@ impl Default for Config { } } impl<'de> Deserialize<'de> for Config { - fn deserialize>(de: D) -> ::std::result::Result { + fn deserialize>(de: D) -> std::result::Result { let raw = Value::deserialize(de)?; if is_legacy_format(&raw) { @@ -312,7 +312,7 @@ impl<'de> Deserialize<'de> for Config { } impl Serialize for Config { - fn serialize(&self, s: S) -> ::std::result::Result { + fn serialize(&self, s: S) -> std::result::Result { use serde::ser::Error; let mut table = self.rest.clone(); diff --git a/src/lib.rs b/src/lib.rs index 0494d984..e5fe7f45 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -122,20 +122,20 @@ pub mod errors { error_chain! { foreign_links { - Io(::std::io::Error) #[doc = "A wrapper around `std::io::Error`"]; - HandlebarsRender(::handlebars::RenderError) #[doc = "Handlebars rendering failed"]; - HandlebarsTemplate(Box<::handlebars::TemplateError>) #[doc = "Unable to parse the template"]; - Utf8(::std::string::FromUtf8Error) #[doc = "Invalid UTF-8"]; - SerdeJson(::serde_json::Error) #[doc = "JSON conversion failed"]; + Io(std::io::Error) #[doc = "A wrapper around `std::io::Error`"]; + HandlebarsRender(handlebars::RenderError) #[doc = "Handlebars rendering failed"]; + HandlebarsTemplate(Box) #[doc = "Unable to parse the template"]; + Utf8(std::string::FromUtf8Error) #[doc = "Invalid UTF-8"]; + SerdeJson(serde_json::Error) #[doc = "JSON conversion failed"]; } links { - TomlQuery(::toml_query::error::Error, ::toml_query::error::ErrorKind) #[doc = "A TomlQuery error"]; + TomlQuery(toml_query::error::Error, toml_query::error::ErrorKind) #[doc = "A TomlQuery error"]; } errors { /// A subprocess exited with an unsuccessful return code. - Subprocess(message: String, output: ::std::process::Output) { + Subprocess(message: String, output: std::process::Output) { description("A subprocess failed") display("{}: {}", message, String::from_utf8_lossy(&output.stdout)) } @@ -155,8 +155,8 @@ pub mod errors { } // Box to halve the size of Error - impl From<::handlebars::TemplateError> for Error { - fn from(e: ::handlebars::TemplateError) -> Error { + impl From for Error { + fn from(e: handlebars::TemplateError) -> Error { From::from(Box::new(e)) } } diff --git a/src/main.rs b/src/main.rs index 22aac744..14aad67a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,7 +58,7 @@ fn main() { if let Err(e) = res { utils::log_backtrace(&e); - ::std::process::exit(101); + std::process::exit(101); } } diff --git a/tests/rendered_output.rs b/tests/rendered_output.rs index 12aa3a3b..dfee1793 100644 --- a/tests/rendered_output.rs +++ b/tests/rendered_output.rs @@ -403,7 +403,7 @@ fn theme_dir_overrides_work_correctly() { let book_dir = book_dir.path(); let theme_dir = book_dir.join("theme"); - let mut index = ::mdbook::theme::INDEX.to_vec(); + let mut index = mdbook::theme::INDEX.to_vec(); index.extend_from_slice(b"\n"); write_file(&theme_dir, "index.hbs", &index).unwrap();