This commit is contained in:
Vincent Prouillet 2017-05-22 20:58:28 +09:00
parent 92d81509d3
commit 3fb06ac791
3 changed files with 3 additions and 3 deletions

View file

@ -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));

View file

@ -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(())
}

View file

@ -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
}
}