mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
chore: a few minor lints (#10754)
I ran this locally, using current main version of clippy: ```bash cargo dev lint path/to/coreutils -- --workspace --all-features ```
This commit is contained in:
+1
-1
@@ -1113,7 +1113,7 @@ impl Options {
|
||||
});
|
||||
}
|
||||
}
|
||||
overriding_order.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
overriding_order.sort_by_key(|a| a.0);
|
||||
|
||||
let mut attributes = Attributes::NONE;
|
||||
|
||||
|
||||
@@ -421,13 +421,9 @@ impl Iterator for ParagraphStream<'_> {
|
||||
|
||||
let mut in_mail = false;
|
||||
let mut second_done = false; // for when we use crown or tagged mode
|
||||
loop {
|
||||
while let Some(Line::FormatLine(fl)) = self.lines.peek() {
|
||||
// peek ahead
|
||||
// need to explicitly force fl out of scope before we can call self.lines.next()
|
||||
let Some(Line::FormatLine(fl)) = self.lines.peek() else {
|
||||
break;
|
||||
};
|
||||
|
||||
if p_lines.is_empty() {
|
||||
// first time through the loop, get things set up
|
||||
// detect mail header
|
||||
|
||||
+1
-2
@@ -3579,8 +3579,7 @@ fn get_security_context<'a>(
|
||||
};
|
||||
|
||||
return uucore::smack::get_smack_label_for_path(&target_path)
|
||||
.map(Cow::Owned)
|
||||
.unwrap_or(Cow::Borrowed(SUBSTITUTE_STRING));
|
||||
.map_or(Cow::Borrowed(SUBSTITUTE_STRING), Cow::Owned);
|
||||
}
|
||||
|
||||
Cow::Borrowed(SUBSTITUTE_STRING)
|
||||
|
||||
@@ -543,10 +543,7 @@ pub fn sanitize_sha2_sha3_length_str(algo_kind: AlgoKind, length: &str) -> UResu
|
||||
pub fn unescape_filename(filename: &[u8]) -> (Vec<u8>, &'static str) {
|
||||
let mut unescaped = Vec::with_capacity(filename.len());
|
||||
let mut byte_iter = filename.iter().peekable();
|
||||
loop {
|
||||
let Some(byte) = byte_iter.next() else {
|
||||
break;
|
||||
};
|
||||
while let Some(byte) = byte_iter.next() {
|
||||
if *byte == b'\\' {
|
||||
match byte_iter.next() {
|
||||
Some(b'\\') => unescaped.push(b'\\'),
|
||||
|
||||
Reference in New Issue
Block a user