diff --git a/src/bin/console.rs b/src/bin/console.rs index 63296cca..a514c8eb 100644 --- a/src/bin/console.rs +++ b/src/bin/console.rs @@ -66,7 +66,7 @@ pub fn report_elapsed_time(instant: Instant) { /// Display an error message and the actual error(s) pub fn unravel_errors(message: &str, error: &Error) { - if message.len() > 0 { + if !message.is_empty() { self::error(message); } self::error(&format!("Error: {}", error)); diff --git a/src/fs.rs b/src/fs.rs index 9500e654..be089723 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -14,7 +14,7 @@ pub fn create_file(path: &Path, content: &str) -> Result<()> { /// Create a directory at the given path if it doesn't exist already pub fn ensure_directory_exists(path: &Path) -> Result<()> { if !path.exists() { - create_directory(&path)?; + create_directory(path)?; } Ok(()) } diff --git a/src/site.rs b/src/site.rs index e7c0a0d9..1341afdb 100644 --- a/src/site.rs +++ b/src/site.rs @@ -181,7 +181,7 @@ impl Site { /// Defaults to `AnchorInsert::None` if no parent section found pub fn find_parent_section_insert_anchor(&self, parent_path: &PathBuf) -> InsertAnchor { match self.sections.get(&parent_path.join("_index.md")) { - Some(ref s) => s.meta.insert_anchor.unwrap(), + Some(s) => s.meta.insert_anchor.unwrap(), None => InsertAnchor::None } }