Skip to content
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 24 commits into from
Oct 19, 2024
Merged

Clippy lints #125

merged 24 commits into from
Oct 19, 2024

Conversation

allan2
Copy link
Collaborator

@allan2 allan2 commented Oct 16, 2024

Hi,

This PR fixes some Clippy lints and also defines lint rules.

  • map_unwrap_or was not fixed in case maintainers prefer the current style
  • doc_markdown was not fixed completely. "MAD_"-prefixed values were not changed in case maintainers prefer the current style
  • cast_mut, used to fix ptr_cast_constness, bumps the MSRV from 1.60.0 (2022-04-07) to 1.65.0 (2022-11-03).

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.
@RazrFalcon
Copy link
Owner

Is there a point in marking methods as const when memmap cannot be used in a const context anyway?

This crate can't be used in a const context anyway.
@allan2
Copy link
Collaborator Author

allan2 commented Oct 16, 2024

Good point. I removed const fn.

@RazrFalcon
Copy link
Owner

Also, build is failing on older Rust.

allan2 added 12 commits October 18, 2024 10:42
`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.
@allan2
Copy link
Collaborator Author

allan2 commented Oct 18, 2024

PR updated and ready for review/CI.

This is to pass CI MSRV 1.36.0. `pointer::cast` was introduced in
1.38.0.
@allan2
Copy link
Collaborator Author

allan2 commented Oct 19, 2024

Thanks for taking the time to review this PR. All requested changes have been implemented.

@RazrFalcon RazrFalcon merged commit b7c98cb into RazrFalcon:master Oct 19, 2024
13 checks passed
@RazrFalcon
Copy link
Owner

Thanks!

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