-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix lints (*very large* PR) #1443
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
All tests pass, see AppVeyor for |
In my opinion we should update the Minimum Supported Release to 1.36, and fix the uses of |
Sorry for lack of response. I will be more active going forward. @ArniDagur I agree. I'm actually tempted to bump us up to 1.39 to experiment with async/await. @rivy can you also rebase? The only thing that should be different so far is |
- convert to newer `..=` syntax, fixing compiler warnings + requires MinSRV >= v1.26.0 .# [why] The inclusive range operator (`..=`) was stabilized in rust v1.26.0. Warnings requesting conversion from the old `...` operator to `..=` were introduced in rust v1.37.0. * ref: <https://github.com/rust-lang/rust/blob/master/RELEASES.md>
- convert to newer `?` syntax, fixing compiler warnings + requires MinSRV >= v1.13.0 .# [why] The `?` operator was stabilized in rust v1.13.0. Warnings requesting conversion from the old `try!` macro to the `?` operator were introduced in rust v1.39.0. * ref: <https://github.com/rust-lang/rust/blob/master/RELEASES.md>
…t,end}...` - `trim_{start,end}{,_matches}` stabilized in rust v1.30.0 - `trim_{start,end}{,_matches}` deprecated (with compiler warnings) in rust v1.33.0 + requires MinSRV >= v1.30.0 * ref: https://github.com/rust-lang/rust/blob/master/RELEASES.md
- rust usually uses `assert_eq!(ACTUAL, EXPECTED)` - ref: https://users.rust-lang.org/t/assert-eq-expected-and-actual/20304/3 @@ https://archive.is/xPp9R
+ ToDO added ~ when possible, test under WSL2 and differentiate/liberalize if possible
…ions - allow actual outputs to differ from expected (ie, `stat`) if `stat` is reporting "unknown" creation time .# [why] For many *nix flavors, `stat` is unable to detect birth/creation date for directories/files. The information is available via the `statx()` system call (for linux kernels >= v4.11), and rust supplies that information via fs::MetadataExt for v1.40+. So, for rust v1.40+, there will likely be a mismatch between the output of the system `stat` and this ('uutils') `stat`. * ref: <https://askubuntu.com/questions/470134/how-do-i-find-the-creation-time-of-a-file> @@ <https://archive.is/IsEAJ>
…at due to race conditions
.# [why] `mem::ununitialized()` is deprecated as of rust v1.39.0. And this use is likely a premature optimization attempting to avoid initializing the byte array to 0, which is usually a *very* fast operation. * ref: <https://github.com/rust-lang/rust/blob/master/RELEASES.md> * ref: <https://stackoverflow.com/questions/3654905/faster-way-to-zero-memory-than-with-memset>
…in {for f64 comparisons})
.# [why] Although `copied()` is preffered, it was not stabilized until rust v1.35.0. So, 'map_clone' is allowed instead of increasing MinSRV to v1.35.0. * ref: https://github.com/rust-lang/rust/blob/master/RELEASES.md
…; `clippy` bug workaround) * ref: <rust-lang/rust-clippy#4898>
…eral {for dynamic code})
…::uninitialized) .# [why] `std::mem::MaybeUninit` is likely preffered. But `MaybeUninit` was not stabilized until rust v1.36.0 and conversion from `mem::uninitialized` is not obviously straight-forward at the moment. So, 'std::mem::uninitialized' is allowed instead of increasing MinSRV to v1.36.0. * ref: https://github.com/rust-lang/rust/blob/master/RELEASES.md
@Arcterus , glad to see you back! I've rebased all three PRs and committed a couple of needed fixups. I think merging the sub-PRs first would be easier to digest, but I'm happy to support whatever is easier for you. I've got one more substantial PR that I'll post tomorrow which includes refactored features so that
|
Closing in favor of #1449 (which includes these commits). |
This is a multi-week effort to fix all
cargo clippy
lint complaints.I've made significant effort to segregate the changes by
clippy
category per commit.The last commits (containing "allow ...") are added allow attributes for code that
clippy
doesn't like but has no easy refactor (or would increase MinSRV).I tried to be very mechanical and straight-forward about all refactors. But, I'm happy to work on any of this if you disagree with any of the refactoring choices or the "allow" commits.