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

Apply clippy fixes #1090

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Apply clippy fixes #1090

wants to merge 1 commit into from

Conversation

jayvdb
Copy link
Contributor

@jayvdb jayvdb commented Sep 10, 2024

Most of these are based on the automatic clippy --fix changes, with some many changes to reduce the noise.
max_value() to MAX and the cfg change are manual.

After this PR there are two more clippy warnings, which I didnt apply because I am worried it may slightly change the API, thus introduce backwards incompatibility.

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
    --> src/path/path.rs:1018:1
     |
1018 | impl<'a> Into<&'a std::path::Path> for &'a Path {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
             https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
     = note: `#[warn(clippy::from_over_into)]` on by default
help: replace the `Into` implementation with `From<&'a path::path::Path>`
     |
1018 ~ impl<'a> From<&'a Path> for &'a std::path::Path {
1019 ~     fn from(val: &'a Path) -> Self {
1020 ~         std::path::Path::new(&val.inner)
     |

warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true
   --> src/path/pathbuf.rs:367:1
    |
367 | impl Into<std::path::PathBuf> for PathBuf {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: `impl From<Local> for Foreign` is allowed by the orphan rules, for more information see
            https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
help: replace the `Into` implementation with `From<path::pathbuf::PathBuf>`
    |
367 ~ impl From<PathBuf> for std::path::PathBuf {
368 ~     fn from(val: PathBuf) -> Self {
369 ~         val.inner

    |

warning: `async-std` (lib) generated 2 warnings (run `cargo clippy --fix --lib -p async-std` to apply 2 suggestions)

Note I dont see any substantive overlap with #948 , so I guess that the clippy warnings from 2021 have all since been addressed and that PR can be closed.

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.

1 participant