mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
remove some collapsible_if (#12539)
* remove some collapsible_if * Use .ok() == .ok() Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com> --------- Co-authored-by: oech3 <> Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:
@@ -115,11 +115,9 @@ fn parse_tabstops(s: &str) -> Result<TabConfig, ParseError> {
|
||||
|
||||
// Handle the increment if specified
|
||||
// Only add an extra tab stop if increment is non-zero
|
||||
if let Some(inc) = increment_size {
|
||||
if inc > 0 {
|
||||
let last = *nums.last().unwrap();
|
||||
nums.push(last + inc);
|
||||
}
|
||||
if let Some(inc) = increment_size.filter(|&i| i > 0) {
|
||||
let last = *nums.last().unwrap();
|
||||
nums.push(last + inc);
|
||||
}
|
||||
|
||||
if let (false, _) = nums
|
||||
|
||||
@@ -633,12 +633,7 @@ pub fn infos_refer_to_same_file(
|
||||
info1: IOResult<FileInformation>,
|
||||
info2: IOResult<FileInformation>,
|
||||
) -> bool {
|
||||
if let Ok(info1) = info1 {
|
||||
if let Ok(info2) = info2 {
|
||||
return info1 == info2;
|
||||
}
|
||||
}
|
||||
false
|
||||
info1.is_ok() && info1.ok() == info2.ok()
|
||||
}
|
||||
|
||||
/// Converts absolute `path` to be relative to absolute `to` path.
|
||||
|
||||
Reference in New Issue
Block a user