diff options
author | lzutao <taolzu@gmail.com> | 2019-05-26 01:50:41 +0700 |
---|---|---|
committer | Dylan DPC <dylan.dpc@gmail.com> | 2019-05-25 20:50:41 +0200 |
commit | 8542f7f29d2f84f2c1dc91d17c87501563b56879 (patch) | |
tree | 5e6b4e2ee74258eca93099e862cf5ac605994c14 /src/book | |
parent | fe492d1cb9262951e378d87a35ca1927d938ee91 (diff) |
Transition to 2018 edition (#933)
* Transition to 2018 edition
* Update Travis CI badge in README
* Remove non-idiomatic `extern crate` lines
Diffstat (limited to 'src/book')
-rw-r--r-- | src/book/book.rs | 4 | ||||
-rw-r--r-- | src/book/init.rs | 7 | ||||
-rw-r--r-- | src/book/mod.rs | 11 | ||||
-rw-r--r-- | src/book/summary.rs | 2 |
4 files changed, 11 insertions, 13 deletions
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<P: AsRef<Path>>(src_dir: P, cfg: &BuildConfig) -> Result<Book> { 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}; |