-
Notifications
You must be signed in to change notification settings - Fork 65
xargs: add support for -E option #593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #593 +/- ##
==========================================
+ Coverage 88.88% 91.69% +2.81%
==========================================
Files 31 31
Lines 6297 6179 -118
Branches 324 327 +3
==========================================
+ Hits 5597 5666 +69
+ Misses 578 392 -186
+ Partials 122 121 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I'll add more test coverage and post an update. |
src/xargs/mod.rs
Outdated
| match self.reader.next() { | ||
| Err(e) => Err(e), | ||
| Ok(arg) => match arg { | ||
| None => Ok(None), | ||
| Some(arg) => { | ||
| if arg.arg == self.eof_delimiter { | ||
| Ok(None) | ||
| } else { | ||
| Ok(Some(arg)) | ||
| } | ||
| } | ||
| }, | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can simplify the code a bit by using map. Something like:
| match self.reader.next() { | |
| Err(e) => Err(e), | |
| Ok(arg) => match arg { | |
| None => Ok(None), | |
| Some(arg) => { | |
| if arg.arg == self.eof_delimiter { | |
| Ok(None) | |
| } else { | |
| Ok(Some(arg)) | |
| } | |
| } | |
| }, | |
| } | |
| self.reader.next().map(|opt| { | |
| opt.and_then(|arg| { | |
| if arg.arg == self.eof_delimiter { | |
| None | |
| } else { | |
| Some(arg) | |
| } | |
| }) | |
| }) |
|
Thanks for your PR! |
No description provided.