diff options
Diffstat (limited to 'src/book')
-rw-r--r-- | src/book/mod.rs | 8 | ||||
-rw-r--r-- | src/book/summary.rs | 2 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/book/mod.rs b/src/book/mod.rs index 57ae2e3f..c2effe0f 100644 --- a/src/book/mod.rs +++ b/src/book/mod.rs @@ -5,6 +5,7 @@ //! //! [1]: ../index.html +#[allow(clippy::module_inception)] mod book; mod init; mod summary; @@ -126,8 +127,6 @@ impl MDBook { /// ```no_run /// # use mdbook::MDBook; /// # use mdbook::book::BookItem; - /// # #[allow(unused_variables)] - /// # fn main() { /// # let book = MDBook::load("mybook").unwrap(); /// for item in book.iter() { /// match *item { @@ -143,7 +142,6 @@ impl MDBook { /// // 2. Chapter 2 /// // /// // etc. - /// # } /// ``` pub fn iter(&self) -> BookItems<'_> { self.book.iter() @@ -405,7 +403,7 @@ fn interpret_custom_preprocessor(key: &str, table: &Value) -> Box<CmdPreprocesso .map(ToString::to_string) .unwrap_or_else(|| format!("mdbook-{}", key)); - Box::new(CmdPreprocessor::new(key.to_string(), command.to_string())) + Box::new(CmdPreprocessor::new(key.to_string(), command)) } fn interpret_custom_renderer(key: &str, table: &Value) -> Box<CmdRenderer> { @@ -418,7 +416,7 @@ fn interpret_custom_renderer(key: &str, table: &Value) -> Box<CmdRenderer> { let command = table_dot_command.unwrap_or_else(|| format!("mdbook-{}", key)); - Box::new(CmdRenderer::new(key.to_string(), command.to_string())) + Box::new(CmdRenderer::new(key.to_string(), command)) } /// Check whether we should run a particular `Preprocessor` in combination diff --git a/src/book/summary.rs b/src/book/summary.rs index 1e130537..d9d6bcb5 100644 --- a/src/book/summary.rs +++ b/src/book/summary.rs @@ -281,7 +281,7 @@ impl<'a> SummaryParser<'a> { } else { Ok(Link { name, - location: PathBuf::from(href.to_string()), + location: PathBuf::from(href), number: None, nested_items: Vec::new(), }) |