Skip to content

Commit 27d771e

Browse files
Add "needless_borrow" lint
Add result of auto-fixing with: "cargo clippy --fix -- --allow 'clippy::all' --deny 'clippy::needless_borrow'"
1 parent 5e7f5c4 commit 27d771e

File tree

9 files changed

+111
-109
lines changed

9 files changed

+111
-109
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ errno = "0.3"
4343

4444
[workspace.lints]
4545

46+
[workspace.lints.clippy]
47+
needless_borrow = "deny"

file/file.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ fn analyze_file(mut path: String, args: &Args, magic_files: &Vec<PathBuf>) {
182182
println!("{path}: empty");
183183
return;
184184
}
185-
match get_type_from_magic_file_dbs(&PathBuf::from(&path), &magic_files) {
185+
match get_type_from_magic_file_dbs(&PathBuf::from(&path), magic_files) {
186186
Some(f_type) => println!("{path}: {f_type}"),
187187
None => println!("{path}: data"),
188188
}

fs/df.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl Mount {
239239
let percentage_used = percentage_used.ceil() as u32;
240240

241241
FieldsData {
242-
fields: &fields,
242+
fields: fields,
243243
source: &self.devname,
244244
size: total,
245245
used,

0 commit comments

Comments
 (0)