From 8542f7f29d2f84f2c1dc91d17c87501563b56879 Mon Sep 17 00:00:00 2001 From: lzutao Date: Sun, 26 May 2019 01:50:41 +0700 Subject: Transition to 2018 edition (#933) * Transition to 2018 edition * Update Travis CI badge in README * Remove non-idiomatic `extern crate` lines --- src/book/book.rs | 4 ++-- src/book/init.rs | 7 +++---- src/book/mod.rs | 11 +++++------ src/book/summary.rs | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) (limited to 'src/book') diff --git a/src/book/book.rs b/src/book/book.rs index f4870f1f..6a31c9e8 100644 --- a/src/book/book.rs +++ b/src/book/book.rs @@ -5,8 +5,8 @@ use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use super::summary::{parse_summary, Link, SectionNumber, Summary, SummaryItem}; -use config::BuildConfig; -use errors::*; +use crate::config::BuildConfig; +use crate::errors::*; /// Load a book into memory from its `src/` directory. pub fn load_book>(src_dir: P, cfg: &BuildConfig) -> Result { diff --git a/src/book/init.rs b/src/book/init.rs index a70006bb..f940e1fa 100644 --- a/src/book/init.rs +++ b/src/book/init.rs @@ -1,12 +1,11 @@ use std::fs::{self, File}; use std::io::Write; use std::path::PathBuf; -use toml; use super::MDBook; -use config::Config; -use errors::*; -use theme; +use crate::config::Config; +use crate::errors::*; +use crate::theme; /// A helper for setting up a new book and its directory structure. #[derive(Debug, Clone, PartialEq)] diff --git a/src/book/mod.rs b/src/book/mod.rs index 040e7265..3b25c68e 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -20,14 +20,14 @@ use std::string::ToString; use tempfile::Builder as TempFileBuilder; use toml::Value; -use errors::*; -use preprocess::{ +use crate::errors::*; +use crate::preprocess::{ CmdPreprocessor, IndexPreprocessor, LinkPreprocessor, Preprocessor, PreprocessorContext, }; -use renderer::{CmdRenderer, HtmlHandlebars, RenderContext, Renderer}; -use utils; +use crate::renderer::{CmdRenderer, HtmlHandlebars, RenderContext, Renderer}; +use crate::utils; -use config::Config; +use crate::config::Config; /// The object used to manage and build a book. pub struct MDBook { @@ -124,7 +124,6 @@ impl MDBook { /// `(section: String, bookitem: &BookItem)` /// /// ```no_run - /// # extern crate mdbook; /// # use mdbook::MDBook; /// # use mdbook::book::BookItem; /// # #[allow(unused_variables)] diff --git a/src/book/summary.rs b/src/book/summary.rs index e61a3459..2c32cbd8 100644 --- a/src/book/summary.rs +++ b/src/book/summary.rs @@ -1,4 +1,4 @@ -use errors::*; +use crate::errors::*; use memchr::{self, Memchr}; use pulldown_cmark::{self, Event, Tag}; use std::fmt::{self, Display, Formatter}; -- cgit v1.2.3