find: Implement -anewer and -cnewer.#386
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #386 +/- ##
==========================================
+ Coverage 58.70% 59.04% +0.33%
==========================================
Files 30 30
Lines 3821 3855 +34
Branches 841 850 +9
==========================================
+ Hits 2243 2276 +33
- Misses 1254 1255 +1
Partials 324 324 ☔ View full report in Codecov by Sentry. |
| #[cfg(target_os = "linux")] | ||
| let x_options = ["a", "c", "m"]; | ||
| #[cfg(not(target_os = "linux"))] | ||
| let x_options = ["a", "B", "c", "m"]; | ||
| #[cfg(target_os = "linux")] | ||
| let y_options = ["a", "c", "m"]; | ||
| #[cfg(not(target_os = "linux"))] | ||
| let y_options = ["a", "B", "c", "m"]; |
There was a problem hiding this comment.
As x_options and y_options contain the same values, I think it is unnecessary to have two vars. And so my suggestion is to simply use options.
|
|
||
| for &x in &x_options { | ||
| for &y in &y_options { | ||
| let arg = &format!("-newer{x}{y}").to_string(); |
There was a problem hiding this comment.
Calling to_string() is unnecessary because format! already returns a string.
| let arg = &format!("-newer{x}{y}").to_string(); | |
| let arg = &format!("-newer{x}{y}"); |
| for &x in &x_options { | ||
| for &y in &y_options { |
There was a problem hiding this comment.
I think the references are not necessary and you can simply use for x in x_options.
| for &arg in &args { | ||
| for &time in × { | ||
| let arg = &format!("{arg}{time}").to_string(); |
There was a problem hiding this comment.
See my previous comments.
|
Thanks. I'm sorry for these issues, they have been fixed in new commits. |
|
Thanks. There's no need to be sorry, the things I mentioned are minor details ;-) And it's great that you fixed them in |
implement: #370
Added extra judgment to
parse_str_to_newer_args()function.-aneweris equivalent to-neweram-cneweris equivalent to-newercm-neweris equicalent to-newermmBFS test
+1 PASSin commit 57f2a3b.This PR does not solve Parsing multiple time formats, I will open a new PR to handle it separately. : )