Skip to content
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
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,6 @@ semicolon_if_nothing_returned = "warn"
single_char_pattern = "warn"
explicit_iter_loop = "warn"
if_not_else = "warn"
manual_let_else = "warn"

all = { level = "deny", priority = -1 }
cargo = { level = "warn", priority = -1 }
Expand Down Expand Up @@ -695,7 +694,6 @@ enum_glob_use = "allow"
ptr_cast_constness = "allow"
borrow_as_ptr = "allow"
ptr_as_ptr = "allow"
manual_let_else = "allow"
unnecessary_semicolon = "allow"
needless_raw_string_hashes = "allow"
unreadable_literal = "allow"
Expand Down
16 changes: 6 additions & 10 deletions src/uucore/src/lib/features/format/argument.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,14 @@ impl<'a> FormatArguments<'a> {
{
// If this fails (this can only happens on Windows), then just
// return NotNumeric.
let s = match os_str_as_bytes(os) {
Ok(s) => s,
Err(_) => return Err(ExtendedParserError::NotNumeric),
let Ok(s) = os_str_as_bytes(os) else {
return Err(ExtendedParserError::NotNumeric);
};

let bytes = match s.split_first() {
Some((b'"', bytes)) | Some((b'\'', bytes)) => bytes,
_ => {
// This really can't happen, the string we are given must start with '/".
debug_assert!(false);
return Err(ExtendedParserError::NotNumeric);
}
let (Some((b'"', bytes)) | Some((b'\'', bytes))) = s.split_first() else {
// This really can't happen, the string we are given must start with '/".
debug_assert!(false);
return Err(ExtendedParserError::NotNumeric);
};

if bytes.is_empty() {
Expand Down
5 changes: 2 additions & 3 deletions src/uucore/src/lib/features/systemd_logind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,8 @@ pub fn read_login_records() -> UResult<Vec<SystemdLoginRecord>> {
// Iterate through all sessions
for session_id in sessions {
// Get session UID using safe wrapper
let uid = match login::get_session_uid(&session_id) {
Ok(uid) => uid,
Err(_) => continue,
let Ok(uid) = login::get_session_uid(&session_id) else {
continue;
};

// Get username from UID
Expand Down
Loading