summaryrefslogtreecommitdiffstats
path: root/src/book
diff options
context:
space:
mode:
authorEric Huss <eric@huss.org>2020-05-10 08:29:50 -0700
committerEric Huss <eric@huss.org>2020-05-10 08:29:50 -0700
commitc44ef1b2f0dce84c09e6f6a8d54ab35b035c40e4 (patch)
tree7d9c1c37fc5370626859c72089086fafcde6ed3b /src/book
parent11f95f76e6d054af294d46c946e32e98b4afb2e5 (diff)
Fix some clippy warnings.
Diffstat (limited to 'src/book')
-rw-r--r--src/book/mod.rs8
-rw-r--r--src/book/summary.rs2
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(),
})