Clippy
This commit is contained in:
parent
92d81509d3
commit
3fb06ac791
|
@ -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));
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue