Skip to content

Commit fa4837b

Browse files
committed
clippy: re-enable manual_let_else lint
1 parent f253efe commit fa4837b

3 files changed

Lines changed: 8 additions & 15 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,6 @@ semicolon_if_nothing_returned = "warn"
628628
single_char_pattern = "warn"
629629
explicit_iter_loop = "warn"
630630
if_not_else = "warn"
631-
manual_let_else = "warn"
632631

633632
all = { level = "deny", priority = -1 }
634633
cargo = { level = "warn", priority = -1 }
@@ -695,7 +694,6 @@ enum_glob_use = "allow"
695694
ptr_cast_constness = "allow"
696695
borrow_as_ptr = "allow"
697696
ptr_as_ptr = "allow"
698-
manual_let_else = "allow"
699697
unnecessary_semicolon = "allow"
700698
needless_raw_string_hashes = "allow"
701699
unreadable_literal = "allow"

src/uucore/src/lib/features/format/argument.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,14 @@ impl<'a> FormatArguments<'a> {
122122
{
123123
// If this fails (this can only happens on Windows), then just
124124
// return NotNumeric.
125-
let s = match os_str_as_bytes(os) {
126-
Ok(s) => s,
127-
Err(_) => return Err(ExtendedParserError::NotNumeric),
125+
let Ok(s) = os_str_as_bytes(os) else {
126+
return Err(ExtendedParserError::NotNumeric);
128127
};
129128

130-
let bytes = match s.split_first() {
131-
Some((b'"', bytes)) | Some((b'\'', bytes)) => bytes,
132-
_ => {
133-
// This really can't happen, the string we are given must start with '/".
134-
debug_assert!(false);
135-
return Err(ExtendedParserError::NotNumeric);
136-
}
129+
let (Some((b'"', bytes)) | Some((b'\'', bytes))) = s.split_first() else {
130+
// This really can't happen, the string we are given must start with '/".
131+
debug_assert!(false);
132+
return Err(ExtendedParserError::NotNumeric);
137133
};
138134

139135
if bytes.is_empty() {

src/uucore/src/lib/features/systemd_logind.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,8 @@ pub fn read_login_records() -> UResult<Vec<SystemdLoginRecord>> {
350350
// Iterate through all sessions
351351
for session_id in sessions {
352352
// Get session UID using safe wrapper
353-
let uid = match login::get_session_uid(&session_id) {
354-
Ok(uid) => uid,
355-
Err(_) => continue,
353+
let Ok(uid) = login::get_session_uid(&session_id) else {
354+
continue;
356355
};
357356

358357
// Get username from UID

0 commit comments

Comments
 (0)