diff --git a/src/gitignore.rs b/src/gitignore.rs index 5b2f92f1..a67185ae 100644 --- a/src/gitignore.rs +++ b/src/gitignore.rs @@ -4,6 +4,7 @@ use std::fs; use std::io; use std::io::Read; use std::path::{Path, PathBuf}; +use std::borrow::{ToOwned}; use walkdir::WalkDir; pub struct Gitignore { @@ -58,7 +59,7 @@ pub fn load(paths: &[PathBuf]) -> Gitignore { } } - p = current.parent().map(|p| p.to_owned()); + p = current.parent().map(ToOwned::to_owned); } if let Some(root) = top_level_git_dir { @@ -70,7 +71,7 @@ pub fn load(paths: &[PathBuf]) -> Gitignore { .filter(|e| e.file_name() == ".gitignore") { let gitignore_path = entry.path(); - if let Ok(f) = GitignoreFile::new(&gitignore_path) { + if let Ok(f) = GitignoreFile::new(gitignore_path) { debug!("Loaded {:?}", gitignore_path); files.push(f); } else { diff --git a/src/ignore.rs b/src/ignore.rs index 7988b025..c9df5eeb 100644 --- a/src/ignore.rs +++ b/src/ignore.rs @@ -80,7 +80,7 @@ pub fn load(paths: &[PathBuf]) -> Ignore { .filter(|e| e.file_name() == ".ignore") { let ignore_path = entry.path(); - if let Ok(f) = IgnoreFile::new(&ignore_path) { + if let Ok(f) = IgnoreFile::new(ignore_path) { debug!("Loaded {:?}", ignore_path); files.push(f); } else {