Skip to content

Commit 9c01402

Browse files
authored
Merge pull request #279 from fox0/clippy--unwrap_or_default
Fix clippy::upper_case_acronyms and clippy::unwrap_or_default
2 parents b8b8bc9 + e495b80 commit 9c01402

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

file/dd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ const CONV_ASCII_EBCDIC: [u8; 256] = [
7171
0xdd, 0xde, 0xdf, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
7272
];
7373

74+
#[allow(clippy::upper_case_acronyms)]
7475
enum AsciiConv {
7576
Ascii,
7677
EBCDIC,

i18n/gencat.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,7 @@ impl MessageCatalog {
610610
+ string_offset;
611611

612612
let msg = String::from_utf8_lossy(&string_pool[string_offset..msg_end]).to_string();
613-
set_msg
614-
.entry(set_id)
615-
.or_insert_with(BTreeMap::new)
616-
.insert(msg_id, msg);
613+
set_msg.entry(set_id).or_default().insert(msg_id, msg);
617614
}
618615
}
619616

misc/test.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ use std::os::unix::fs::MetadataExt;
1818
use std::os::unix::fs::PermissionsExt;
1919
use std::path::Path;
2020

21-
// unary operators
21+
/// Unary operators
22+
#[allow(clippy::upper_case_acronyms)]
2223
#[derive(PartialEq)]
2324
enum UnaryOp {
2425
Block,
@@ -40,7 +41,7 @@ enum UnaryOp {
4041
StrZero,
4142
}
4243

43-
// binary operators
44+
/// Binary operators
4445
enum BinOp {
4546
PathEquals,
4647
PathNewer,

process/fuser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ mod linux {
10821082
None
10831083
}
10841084
})
1085-
.unwrap_or_else(NameSpace::default)
1085+
.unwrap_or_default()
10861086
}
10871087

10881088
/// Processes file namespaces by expanding paths and updating lists based on the mount flag.

0 commit comments

Comments
 (0)