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
14 changes: 7 additions & 7 deletions src/uu/paste/src/paste.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,13 @@ fn parse_delimiters(delimiters: &OsString) -> UResult<Box<[Box<[u8]>]>> {
}
match bytes[i] {
b'0' => vec.push(Box::new([])),
b'\\' => vec.push(Box::new([b'\\'])),
b'n' => vec.push(Box::new([b'\n'])),
b't' => vec.push(Box::new([b'\t'])),
b'b' => vec.push(Box::new([b'\x08'])),
b'f' => vec.push(Box::new([b'\x0C'])),
b'r' => vec.push(Box::new([b'\r'])),
b'v' => vec.push(Box::new([b'\x0B'])),
b'\\' => vec.push(Box::new(*b"\\")),
b'n' => vec.push(Box::new(*b"\n")),
b't' => vec.push(Box::new(*b"\t")),
b'b' => vec.push(Box::new(*b"\x08")),
b'f' => vec.push(Box::new(*b"\x0C")),
b'r' => vec.push(Box::new(*b"\r")),
b'v' => vec.push(Box::new(*b"\x0B")),
_ => {
// Unknown escape: strip backslash, use the following character(s)
let remaining = &bytes[i..];
Expand Down
12 changes: 6 additions & 6 deletions src/uu/shred/src/shred.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ const PATTERNS: [Pattern; 22] = [
Pattern::Single(b'\xFF'),
Pattern::Single(b'\x55'),
Pattern::Single(b'\xAA'),
Pattern::Multi([b'\x24', b'\x92', b'\x49']),
Pattern::Multi([b'\x49', b'\x24', b'\x92']),
Pattern::Multi([b'\x6D', b'\xB6', b'\xDB']),
Pattern::Multi([b'\x92', b'\x49', b'\x24']),
Pattern::Multi([b'\xB6', b'\xDB', b'\x6D']),
Pattern::Multi([b'\xDB', b'\x6D', b'\xB6']),
Pattern::Multi(*b"\x24\x92\x49"),
Pattern::Multi(*b"\x49\x24\x92"),
Pattern::Multi(*b"\x6D\xB6\xDB"),
Pattern::Multi(*b"\x92\x49\x24"),
Pattern::Multi(*b"\xB6\xDB\x6D"),
Pattern::Multi(*b"\xDB\x6D\xB6"),
Pattern::Single(b'\x11'),
Pattern::Single(b'\x22'),
Pattern::Single(b'\x33'),
Expand Down
5 changes: 2 additions & 3 deletions src/uu/tail/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ pub fn parse_obsolete(src: &OsString) -> Option<Result<ObsoleteArgs, ParseError>
let sign = if let Some(r) = rest.strip_prefix('-') {
rest = r;
'-'
} else if let Some(r) = rest.strip_prefix('+') {
} else {
let r = rest.strip_prefix('+')?;
rest = r;
'+'
} else {
return None;
};

let end_num = rest
Expand Down
2 changes: 1 addition & 1 deletion src/uucore/src/lib/features/format/num_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ fn bd_to_string_exp_with_prec(bd: &BigDecimal, precision: usize) -> (String, i64

// In the unlikely case we had an overflow, correct for that.
if digits.len() == precision + 1 {
debug_assert!(&digits[precision..] == "0");
debug_assert_eq!(&digits[precision..], "0");
digits.truncate(precision);
p -= 1;
}
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 @@ -235,8 +235,8 @@ fn is_root(path: &Path, would_traverse_symlink: bool) -> bool {
// which we need to avoid here.
// All directory-ish paths match "*/", except ".", "..", "*/.", and "*/..".
let path_bytes = path.as_os_str().as_encoded_bytes();
let looks_like_dir = path_bytes == [b'.']
|| path_bytes == [b'.', b'.']
let looks_like_dir = path_bytes == *b"."
|| path_bytes == *b".."
|| path_bytes.ends_with(&[MAIN_SEPARATOR as u8])
|| path_bytes.ends_with(&[MAIN_SEPARATOR as u8, b'.'])
|| path_bytes.ends_with(&[MAIN_SEPARATOR as u8, b'.', b'.']);
Expand Down
Loading