mirror of
https://github.com/sharkdp/fd
synced 2024-10-06 07:49:18 +00:00
Fix some clippy warnings
This commit is contained in:
parent
614f576c47
commit
bba5c4f607
|
@ -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)
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue