Thanks to visit codestin.com
Credit goes to github.com

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
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,6 @@ enum_glob_use = "allow"
ptr_cast_constness = "allow"
borrow_as_ptr = "allow"
ptr_as_ptr = "allow"
unnecessary_semicolon = "allow"
needless_raw_string_hashes = "allow"
unreadable_literal = "allow"
unnested_or_patterns = "allow"
Expand Down
2 changes: 1 addition & 1 deletion src/uu/cksum/src/cksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fn print_legacy_checksum(
print!("{sum} {size}");
}
_ => unreachable!("Not a legacy algorithm"),
};
}

// Print the filename after a space if not stdin
if filename != "-" {
Expand Down
2 changes: 1 addition & 1 deletion src/uu/seq/src/numberparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn compute_num_digits(input: &str, ebd: ExtendedBigDecimal) -> PreciseNumber {
// Also ignore overflowed exponents (unwrap_or(0)).
if exp > 0 {
int_digits += exp.try_into().unwrap_or(0);
};
}
frac_digits = if exp < frac_digits as i64 {
// Subtract from i128 to avoid any overflow
(frac_digits as i128 - exp as i128).try_into().unwrap_or(0)
Expand Down
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/checksum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,7 @@ fn process_checksum_file(
Err(CantOpenFile | FileIsDirectory) => res.failed_open_file += 1,
Err(FileNotFound) if !opts.ignore_missing => res.failed_open_file += 1,
_ => (),
};
}
}

// not a single line correctly formatted found
Expand Down
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl<C: FormatChar> FormatItem<C> {
match self {
Self::Spec(spec) => spec.write(writer, args)?,
Self::Char(c) => return c.write(writer).map_err(FormatError::IoError),
};
}
Ok(ControlFlow::Continue(()))
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/uucore/src/lib/features/format/num_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ impl Formatter<&ExtendedBigDecimal> for Float {
// Pad non-finite numbers with spaces, not zeros.
if alignment == NumberAlignment::RightZero {
alignment = NumberAlignment::RightSpace;
};
}
format_float_non_finite(&abs, self.case)
}
};
Expand Down Expand Up @@ -519,7 +519,7 @@ fn format_float_shortest(
output.push_str(first_digits);
output.push('.');
output.push_str(remaining_digits);
};
}

if force_decimal == ForceDecimal::No {
strip_fractional_zeroes_and_dot(&mut output);
Expand Down Expand Up @@ -636,7 +636,7 @@ fn format_float_hexadecimal(
}
} else {
frac2 <<= wanted_bits - bits;
};
}

// Convert "XXX" to "X.XX": that divides by 16^precision = 2^(4*precision), so add that to the exponent.
let mut digits = frac2.to_str_radix(16);
Expand Down
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/format/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ impl Spec {
// TODO: This should break the _entire execution_ of printf
break;
}
};
}
}
writer.write_all(&parsed).map_err(FormatError::IoError)
}
Expand Down
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/fsext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ impl MountInfo {
mount_option = String::from_utf8_lossy(raw[3]).to_string();
}
_ => return None,
};
}

let dev_id = mount_dev_id(&mount_dir);
let dummy = is_dummy_filesystem(&fs_type, &mount_option);
Expand Down
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn parse_change(mode: &str, fperm: u32, considering_dir: bool) -> (u32, usize) {
'g' => srwx = ((fperm << 3) & 0o700) | (fperm & 0o070) | ((fperm >> 3) & 0o007),
'o' => srwx = ((fperm << 6) & 0o700) | ((fperm << 3) & 0o070) | (fperm & 0o007),
_ => break,
};
}
if ch == 'u' || ch == 'g' || ch == 'o' {
// symbolic modes only allows perms to be a single letter of 'ugo'
// therefore this must either be the first char or it is unexpected
Expand Down
4 changes: 2 additions & 2 deletions src/uucore/src/lib/features/perms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub fn wrap_chown<P: AsRef<Path>>(
entries::gid2grp(dest_gid).unwrap_or_else(|_| dest_gid.to_string())
)
};
};
}
}
}
return Err(out);
Expand Down Expand Up @@ -157,7 +157,7 @@ pub fn wrap_chown<P: AsRef<Path>>(
};
}
_ => (),
};
}
} else if verbosity.level == VerbosityLevel::Verbose {
out = if verbosity.groups_only {
format!(
Expand Down
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pub fn format_system_time<W: Write>(
}
out.write_fmt(format_args!("{secs}.{nsecs:09}"))?;
}
};
}
Ok(())
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/tty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl TryFrom<PathBuf> for Teletype {
.parse::<u64>()
.map_err(|_| ())
.map(Teletype::Pts);
};
}

// Considering this format: **/**/ttyS** then **/**/tty**
let path = value.to_str().ok_or(())?;
Expand Down
Loading