Fix some clippy warnings

This commit is contained in:
sharkdp 2017-10-26 21:13:56 +02:00
parent 614f576c47
commit bba5c4f607
3 changed files with 3 additions and 3 deletions

View File

@ -150,7 +150,7 @@ fn main() {
exclude_patterns: matches
.values_of("exclude")
.map(|v| v.map(|p| String::from("!") + p).collect())
.unwrap_or(vec![]),
.unwrap_or_else(|| vec![]),
};
match RegexBuilder::new(pattern)

View File

@ -51,7 +51,7 @@ pub fn scan(root: &Path, pattern: Arc<Regex>, config: Arc<FdOptions>) {
let mut override_builder = OverrideBuilder::new(root);
for pattern in config.exclude_patterns.iter() {
for pattern in &config.exclude_patterns {
let res = override_builder.add(pattern);
if res.is_err() {
error(&format!("Error: malformed exclude pattern '{}'", pattern));

View File

@ -469,7 +469,7 @@ fn test_symlink() {
let parent_parent = if cfg!(windows) { ".." } else { "../.." };
te.assert_output_subdirectory(
"symlink",
&["", &parent_parent],
&["", parent_parent],
&format!(
"{dir}/a.foo
{dir}/e1 e2