Fix some Rust 1.92 clippy lints (#17324)
Saw this as a build failure in a CI job. Excluding https://github.com/zkat/miette/pull/459
This commit is contained in:
@@ -141,7 +141,7 @@ pub enum Error {
|
||||
#[error("Request failed after {retries} {subject}", subject = if *retries > 1 { "retries" } else { "retry" })]
|
||||
RetriedError {
|
||||
#[source]
|
||||
err: Box<Error>,
|
||||
err: Box<Self>,
|
||||
retries: u32,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ use crate::PythonRunnerOutput;
|
||||
use owo_colors::OwoColorize;
|
||||
use regex::Regex;
|
||||
use thiserror::Error;
|
||||
use tracing::error;
|
||||
use uv_configuration::BuildOutput;
|
||||
use uv_distribution_types::IsBuildBackendError;
|
||||
use uv_fs::Simplified;
|
||||
|
||||
@@ -65,7 +65,7 @@ fn split_glob(pattern: impl AsRef<str>) -> GlobParts {
|
||||
/// Classic trie with edges being path components and values being glob patterns.
|
||||
#[derive(Default)]
|
||||
struct Trie<'a> {
|
||||
children: BTreeMap<Component<'a>, Trie<'a>>,
|
||||
children: BTreeMap<Component<'a>, Self>,
|
||||
patterns: Vec<&'a Path>,
|
||||
}
|
||||
|
||||
|
||||
@@ -302,10 +302,7 @@ pub enum ErrorKind {
|
||||
|
||||
/// Add the number of failed retries to the error.
|
||||
#[error("Request failed after {retries} {subject}", subject = if *retries > 1 { "retries" } else { "retry" })]
|
||||
RequestWithRetries {
|
||||
source: Box<ErrorKind>,
|
||||
retries: u32,
|
||||
},
|
||||
RequestWithRetries { source: Box<Self>, retries: u32 },
|
||||
|
||||
#[error("Received some unexpected JSON from {}", url)]
|
||||
BadJson {
|
||||
|
||||
@@ -57,7 +57,7 @@ pub enum Error {
|
||||
#[error("Request failed after {retries} {subject}", subject = if *retries > 1 { "retries" } else { "retry" })]
|
||||
NetworkErrorWithRetries {
|
||||
#[source]
|
||||
err: Box<Error>,
|
||||
err: Box<Self>,
|
||||
retries: u32,
|
||||
},
|
||||
#[error("Failed to download {0}")]
|
||||
@@ -105,7 +105,7 @@ pub enum Error {
|
||||
#[error("This version of uv is too old to support the JSON Python download list at {0}")]
|
||||
UnsupportedPythonDownloadsJSON(String),
|
||||
#[error("Error while fetching remote python downloads json from '{0}'")]
|
||||
FetchingPythonDownloadsJSONError(String, #[source] Box<Error>),
|
||||
FetchingPythonDownloadsJSONError(String, #[source] Box<Self>),
|
||||
#[error("An offline Python installation was requested, but {file} (from {url}) is missing in {}", python_builds_dir.user_display())]
|
||||
OfflinePythonMissing {
|
||||
file: Box<PythonInstallationKey>,
|
||||
@@ -776,8 +776,7 @@ impl FromStr for PythonDownloadRequest {
|
||||
let mut state = State::new(parts.by_ref());
|
||||
state.next_part();
|
||||
|
||||
loop {
|
||||
let Some(part) = state.part else { break };
|
||||
while let Some(part) = state.part {
|
||||
match state.position {
|
||||
Position::Start => unreachable!("We start before the loop"),
|
||||
Position::Implementation => {
|
||||
|
||||
@@ -38,12 +38,7 @@ use crate::{InMemoryIndex, Options};
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum ResolveError {
|
||||
#[error("Failed to resolve dependencies for package `{1}=={2}`")]
|
||||
Dependencies(
|
||||
#[source] Box<ResolveError>,
|
||||
PackageName,
|
||||
Version,
|
||||
DerivationChain,
|
||||
),
|
||||
Dependencies(#[source] Box<Self>, PackageName, Version, DerivationChain),
|
||||
|
||||
#[error(transparent)]
|
||||
Client(#[from] uv_client::Error),
|
||||
|
||||
@@ -3,7 +3,6 @@ use std::str::FromStr;
|
||||
use std::{collections::BTreeMap, path::Path};
|
||||
|
||||
use thiserror::Error;
|
||||
use tracing::error;
|
||||
|
||||
use uv_distribution_types::RequiresPython;
|
||||
use uv_fs::Simplified;
|
||||
|
||||
Reference in New Issue
Block a user