forked from danburkert/memmap-rs
-
Notifications
You must be signed in to change notification settings - Fork 79
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
Clippy lints #125
Merged
Merged
Clippy lints #125
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This fixes one instance of this lint. The styling of `MADV_` values are unchanged, pending maintainer opinion.
This defines the lint rules in Cargo.toml. The `[lints]` table was introduced in Rust 1.74. The crate still builds on older versions with an `unused key` warning.
Is there a point in marking methods as |
This crate can't be used in a const context anyway.
Good point. I removed |
RazrFalcon
reviewed
Oct 17, 2024
Also, build is failing on older Rust. |
`create` does not truncate by default. If less data is written to the file than it already constains, the remainder of the file will remain unchanged and the end of the file will contain old data. `truncate(true)` ensures the file is entirely overwritten with new data. Formatting for examples was not fixed. That will be dealt with later.
This moves the semicolon terminating the unsafe block to the statement inside the block. Changed to pass the lint.
This sets the Clippy Rust version to 1.36.0, the same as in CI. `cast` and `cast_mut` are removed.
PR updated and ready for review/CI. |
RazrFalcon
reviewed
Oct 19, 2024
RazrFalcon
reviewed
Oct 19, 2024
RazrFalcon
reviewed
Oct 19, 2024
RazrFalcon
reviewed
Oct 19, 2024
This is to pass CI MSRV 1.36.0. `pointer::cast` was introduced in 1.38.0.
Thanks for taking the time to review this PR. All requested changes have been implemented. |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
This PR fixes some Clippy lints and also defines lint rules.
map_unwrap_or
was not fixed in case maintainers prefer the current styledoc_markdown
was not fixed completely. "MAD_"-prefixed values were not changed in case maintainers prefer the current stylecast_mut
, used to fixptr_cast_constness
, bumps the MSRV from 1.60.0 (2022-04-07) to 1.65.0 (2022-11-03).