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
2 changes: 1 addition & 1 deletion src/uu/cp/src/cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 1 addition & 5 deletions src/uu/fmt/src/parasplit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments needs fixing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xtqqczze i wasn't sure if the comment is still relevant - should i just rcemove it?

Copy link
Contributor

@xtqqczze xtqqczze Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • "peek ahead" seems pointless
  • "need to explicitly force fl out of scope before we can call self.lines.next()" is incorrect because fl is in fact in scope when we call next(), it seems a refactoring in 01c32a5 put it in scope.

cc: @tertsdiepraam

// 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
Expand Down
3 changes: 1 addition & 2 deletions src/uu/ls/src/ls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions src/uucore/src/lib/features/checksum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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'\\'),
Expand Down
Loading