+
Skip to content

Fix some clippy warnings #103

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/find/matchers/logical_matchers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! to "-foo -o ( -bar -baz )", not "( -foo -o -bar ) -baz").
use std::error::Error;
use std::iter::Iterator;
use std::path::PathBuf;
use std::path::Path;
use walkdir::DirEntry;

use super::{Matcher, MatcherIO};
Expand Down Expand Up @@ -44,7 +44,7 @@ impl Matcher for AndMatcher {
self.submatchers.iter().any(|x| x.has_side_effects())
}

fn finished_dir(&self, dir: &PathBuf) {
fn finished_dir(&self, dir: &Path) {
for m in &self.submatchers {
m.finished_dir(dir);
}
Expand Down Expand Up @@ -113,7 +113,7 @@ impl Matcher for OrMatcher {
self.submatchers.iter().any(|x| x.has_side_effects())
}

fn finished_dir(&self, dir: &PathBuf) {
fn finished_dir(&self, dir: &Path) {
for m in &self.submatchers {
m.finished_dir(dir);
}
Expand Down Expand Up @@ -204,7 +204,7 @@ impl Matcher for ListMatcher {
self.submatchers.iter().any(|x| x.has_side_effects())
}

fn finished_dir(&self, dir: &PathBuf) {
fn finished_dir(&self, dir: &Path) {
for m in &self.submatchers {
m.finished_dir(dir);
}
Expand Down Expand Up @@ -342,7 +342,7 @@ impl Matcher for NotMatcher {
self.submatcher.has_side_effects()
}

fn finished_dir(&self, dir: &PathBuf) {
fn finished_dir(&self, dir: &Path) {
self.submatcher.finished_dir(dir);
}

Expand Down
4 changes: 2 additions & 2 deletions src/find/matchers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod type_matcher;

use regex::Regex;
use std::error::Error;
use std::path::PathBuf;
use std::path::Path;
use std::time::SystemTime;
use walkdir::DirEntry;

Expand Down Expand Up @@ -70,7 +70,7 @@ pub trait Matcher {
}

/// Notification that find has finished processing a given directory.
fn finished_dir(&self, _finished_directory: &PathBuf) {}
fn finished_dir(&self, _finished_directory: &Path) {}

/// Notification that find has finished processing all directories -
/// allowing for any cleanup that isn't suitable for destructors (e.g.
Expand Down
2 changes: 1 addition & 1 deletion src/find/matchers/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ impl FileTimeMatcher {

pub fn new(file_time_type: FileTimeType, days: ComparableValue) -> FileTimeMatcher {
FileTimeMatcher {
file_time_type,
days,
file_time_type,
}
}

Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载