Skip to content

Conversation

@brian-pane
Copy link
Contributor

(This fixes an incompatibility found by the Gnu findutils test suite)

(This fixes an incompatibility found by the Gnu findutils test suite)
@codecov
Copy link

codecov bot commented Nov 26, 2025

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 91.74%. Comparing base (67cd89b) to head (4bd26a6).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/xargs/mod.rs 96.77% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #603      +/-   ##
==========================================
+ Coverage   91.71%   91.74%   +0.03%     
==========================================
  Files          31       31              
  Lines        6194     6205      +11     
  Branches      327      328       +1     
==========================================
+ Hits         5681     5693      +12     
+ Misses        392      391       -1     
  Partials      121      121              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

.stdout(predicate::str::diff("ab\n"));
}

cargo_bin_cmd!("xargs")
Copy link
Contributor

Choose a reason for hiding this comment

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

please create a new test for this

src/xargs/mod.rs Outdated
}
}

#[allow(clippy::type_complexity)]
Copy link
Contributor

Choose a reason for hiding this comment

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

can we avoid this please? thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The alternatives that come to mind are:

  1. Instead of returning a tuple from that function, return a new Options object.
  2. Or pass in the Options object as a mut reference and modify it.

Would either of those be a good stylistic fit for the rest of the program?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, a new data structure sounds appropriate!

Copy link
Contributor

@sylvestre sylvestre Nov 26, 2025

Choose a reason for hiding this comment

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

4 was probably already too much :)

Copy link
Contributor

Choose a reason for hiding this comment

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

it can be removed now, no ?

src/xargs/mod.rs Outdated
verbose: options.verbose,
eof_delimiter,
}
// (max_args, max_lines, replace, delimiter, eof_delimiter)
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove this comment

src/xargs/mod.rs Outdated
// It is possible to have multiple matches and multiple extra args, and the Cartesian product is desired.
// To be specific, we process extra args one by one, and replace all matches with the same extra arg in each time.
(Some(1), None, &options.replace)
(Some(1), None, options.replace.clone())
Copy link
Contributor

Choose a reason for hiding this comment

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

is the clone really necessary ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the update I just pushed, I changed the function so that option is moved rather than being passed by reference, which eliminates the need for the cloning of fields.

@sylvestre sylvestre merged commit c5c5a16 into uutils:main Dec 7, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants