diff --git a/src/uu/chroot/src/chroot.rs b/src/uu/chroot/src/chroot.rs index 2db68d6e9..ffa921161 100644 --- a/src/uu/chroot/src/chroot.rs +++ b/src/uu/chroot/src/chroot.rs @@ -95,12 +95,12 @@ fn parse_group_list(list_str: &str) -> Result, ChrootError> { if name.is_empty() { // --groups="," continue; - } else { - // --groups=", " - // chroot: invalid group ' ' - show!(ChrootError::InvalidGroup(name.to_string())); - err = true; } + + // --groups=", " + // chroot: invalid group ' ' + show!(ChrootError::InvalidGroup(name.to_string())); + err = true; } else { // TODO Figure out a better condition here. if trimmed_name.starts_with(char::is_numeric) diff --git a/src/uu/cp/src/cp.rs b/src/uu/cp/src/cp.rs index b078063ea..9cb26c221 100644 --- a/src/uu/cp/src/cp.rs +++ b/src/uu/cp/src/cp.rs @@ -2664,9 +2664,8 @@ fn handle_no_preserve_mode(options: &Options, org_mode: u32) -> u32 { const S_IRWXUGO: u32 = (S_IRWXU | S_IRWXG | S_IRWXO) as u32; if is_explicit_no_preserve_mode { return MODE_RW_UGO; - } else { - return org_mode & S_IRWXUGO; - }; + } + return org_mode & S_IRWXUGO; } } diff --git a/src/uu/id/src/id.rs b/src/uu/id/src/id.rs index 0b74e53fd..da2f3a7c5 100644 --- a/src/uu/id/src/id.rs +++ b/src/uu/id/src/id.rs @@ -217,9 +217,9 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> { set_exit_code(1); if i + 1 >= users.len() { break; - } else { - continue; } + + continue; } } } else { diff --git a/src/uu/stty/src/stty.rs b/src/uu/stty/src/stty.rs index a7356d68b..d1df40d6d 100644 --- a/src/uu/stty/src/stty.rs +++ b/src/uu/stty/src/stty.rs @@ -916,9 +916,8 @@ fn string_to_control_char(s: &str) -> Result { if let Some(val) = ascii_num { if val > 255 { return Err(ControlCharMappingError::IntOutOfRange(s.to_string())); - } else { - return Ok(val as u8); } + return Ok(val as u8); } // try to parse ^ or just let mut chars = s.chars(); diff --git a/src/uu/sync/src/sync.rs b/src/uu/sync/src/sync.rs index f4f4218e5..1365f41aa 100644 --- a/src/uu/sync/src/sync.rs +++ b/src/uu/sync/src/sync.rs @@ -143,9 +143,8 @@ mod platform { get_message("sync-error-find-next-volume"), )), }; - } else { - volumes.push(String::from_wide_null(&name)); } + volumes.push(String::from_wide_null(&name)); } } diff --git a/src/uu/uptime/src/uptime.rs b/src/uu/uptime/src/uptime.rs index 142bf1a7c..c3b97dcb1 100644 --- a/src/uu/uptime/src/uptime.rs +++ b/src/uu/uptime/src/uptime.rs @@ -242,7 +242,7 @@ fn process_utmpx(file: Option<&OsString>) -> (Option, usize) { boot_time = Some(dt.unix_timestamp() as time_t); } } - _ => continue, + _ => (), } } (boot_time, nusers)