Fix some nightly lints (#15028)

Apply fixes for some `cargo check` and `cargo clippy` lints that are on
in nightly Rust.

The following command now passes, the blanket allows had to many
false-positives:

```
cargo +nightly clippy -- -A clippy::doc_markdown -A mismatched_lifetime_syntaxes -A clippy::explicit_deref_methods
```

`cargo +nightly check -- -A mismatched_lifetime_syntaxes` now passes
without warnings.
This commit is contained in:
konsti 2025-08-02 20:59:23 +02:00 committed by GitHub
parent 025d209735
commit 368b7b1e12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 43 additions and 51 deletions

View file

@ -1,6 +1,5 @@
use std::borrow::Cow;
use std::collections::{BTreeMap, BTreeSet, VecDeque};
use std::convert::Infallible;
use std::error::Error;
use std::fmt::{Debug, Display, Formatter};
use std::io;
@ -3907,7 +3906,7 @@ struct SourceDistMetadata {
/// future, so this should be treated as only a hint to where to look
/// and/or recording where the source dist file originally came from.
#[derive(Clone, Debug, serde::Deserialize, PartialEq, Eq)]
#[serde(try_from = "SourceDistWire")]
#[serde(from = "SourceDistWire")]
enum SourceDist {
Url {
url: UrlString,
@ -4206,17 +4205,15 @@ impl SourceDist {
}
}
impl TryFrom<SourceDistWire> for SourceDist {
type Error = Infallible;
fn try_from(wire: SourceDistWire) -> Result<SourceDist, Infallible> {
impl From<SourceDistWire> for SourceDist {
fn from(wire: SourceDistWire) -> SourceDist {
match wire {
SourceDistWire::Url { url, metadata } => Ok(SourceDist::Url { url, metadata }),
SourceDistWire::Path { path, metadata } => Ok(SourceDist::Path {
SourceDistWire::Url { url, metadata } => SourceDist::Url { url, metadata },
SourceDistWire::Path { path, metadata } => SourceDist::Path {
path: path.into(),
metadata,
}),
SourceDistWire::Metadata { metadata } => Ok(SourceDist::Metadata { metadata }),
},
SourceDistWire::Metadata { metadata } => SourceDist::Metadata { metadata },
}
}
}