-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Clippy Pendantic #6720
base: main
Are you sure you want to change the base?
Clippy Pendantic #6720
Changes from all commits
5d986bf
353eb53
feae527
cff8cc0
c8b4045
d7602b2
7a0d7c0
961d414
6e35c73
7b98853
ff38e8f
6dbc715
dfa2322
418cd10
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -99,7 +99,7 @@ | |||||
let current_dir = env::current_dir()?; | ||||||
let root_path = current_dir.join(root); | ||||||
let root_parent = if target.exists() && !root.to_str().unwrap().ends_with("/.") { | ||||||
root_path.parent().map(|p| p.to_path_buf()) | ||||||
root_path.parent().map(std::path::Path::to_path_buf) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment about Path
Suggested change
|
||||||
} else { | ||||||
Some(root_path) | ||||||
}; | ||||||
|
@@ -175,7 +175,7 @@ | |||||
let source_is_dir = direntry.path().is_dir(); | ||||||
if path_ends_with_terminator(context.target) && source_is_dir { | ||||||
if let Err(e) = std::fs::create_dir_all(context.target) { | ||||||
eprintln!("Failed to create directory: {}", e); | ||||||
eprintln!("Failed to create directory: {e}"); | ||||||
} | ||||||
} else { | ||||||
descendant = descendant.strip_prefix(context.root)?.to_path_buf(); | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,13 +107,15 @@ impl Filesystem { | |
mount_info.mount_dir.clone() | ||
}; | ||
#[cfg(unix)] | ||
#[allow(clippy::used_underscore_binding)] | ||
let usage = FsUsage::new(statfs(_stat_path).ok()?); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there are reason to keep this as an underscore? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I change it to not an underscore, then I would have to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh. in this case I was worried about the possibility of other There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If that's not the case, then why isn't it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably should be yeah! |
||
#[cfg(windows)] | ||
#[allow(clippy::used_underscore_binding)] | ||
let usage = FsUsage::new(Path::new(&_stat_path)).ok()?; | ||
Some(Self { | ||
file, | ||
mount_info, | ||
usage, | ||
file, | ||
}) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would prefer just
String::as_str
and have an import
repeating std::string isn't providing much value