async-std
async-std copied to clipboard
Apply clippy fixes
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.
(note: I have since added the auto-fixes for these as well) 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 https://github.com/async-rs/async-std/pull/948 , so I guess that the clippy warnings from 2021 have all since been addressed and that PR can be closed.