From 1ed52dc791fc44edd436fe28512f00f713286fd1 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 15 Jun 2026 09:07:41 -0500 Subject: [PATCH] Fix Clippy warnings in nightly check (#19861) --- crates/uv-fastid/src/lib.rs | 7 +------ crates/uv-git-types/src/lib.rs | 2 +- crates/uv-platform-tags/src/abi_tag.rs | 4 ++-- crates/uv-publish/src/lib.rs | 8 ++++---- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/crates/uv-fastid/src/lib.rs b/crates/uv-fastid/src/lib.rs index d352767c08..105129b3d4 100644 --- a/crates/uv-fastid/src/lib.rs +++ b/crates/uv-fastid/src/lib.rs @@ -12,12 +12,7 @@ use std::str::FromStr; use rand::RngCore as _; -const ALPHABET: [u8; 64] = [ - b'_', b'-', b'0', b'1', b'2', b'3', b'4', b'5', b'6', b'7', b'8', b'9', b'a', b'b', b'c', b'd', - b'e', b'f', b'g', b'h', b'i', b'j', b'k', b'l', b'm', b'n', b'o', b'p', b'q', b'r', b's', b't', - b'u', b'v', b'w', b'x', b'y', b'z', b'A', b'B', b'C', b'D', b'E', b'F', b'G', b'H', b'I', b'J', - b'K', b'L', b'M', b'N', b'O', b'P', b'Q', b'R', b'S', b'T', b'U', b'V', b'W', b'X', b'Y', b'Z', -]; +const ALPHABET: [u8; 64] = *b"_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; const MASK: u8 = 63; /// A unique identifier generated by this crate. diff --git a/crates/uv-git-types/src/lib.rs b/crates/uv-git-types/src/lib.rs index ba243593c9..32340abfb2 100644 --- a/crates/uv-git-types/src/lib.rs +++ b/crates/uv-git-types/src/lib.rs @@ -291,7 +291,7 @@ impl From for DisplaySafeUrl { impl std::fmt::Display for GitUrl { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", &self.url) + write!(f, "{}", self.url) } } diff --git a/crates/uv-platform-tags/src/abi_tag.rs b/crates/uv-platform-tags/src/abi_tag.rs index a6219a68d9..9c570268ee 100644 --- a/crates/uv-platform-tags/src/abi_tag.rs +++ b/crates/uv-platform-tags/src/abi_tag.rs @@ -242,7 +242,7 @@ impl FromStr for AbiTag { tag: full_tag.to_string(), })? .checked_sub(b'0') - .and_then(|d| if d < 10 { Some(d) } else { None }) + .filter(|digit| *digit < 10) .ok_or_else(|| ParseAbiTagError::InvalidMajorVersion { implementation, tag: full_tag.to_string(), @@ -275,7 +275,7 @@ impl FromStr for AbiTag { tag: full_tag.to_string(), })? .checked_sub(b'0') - .and_then(|d| if d < 10 { Some(d) } else { None }) + .filter(|digit| *digit < 10) .ok_or_else(|| ParseAbiTagError::InvalidImplMajorVersion { implementation, tag: full_tag.to_string(), diff --git a/crates/uv-publish/src/lib.rs b/crates/uv-publish/src/lib.rs index 56b8097ea4..50bb350142 100644 --- a/crates/uv-publish/src/lib.rs +++ b/crates/uv-publish/src/lib.rs @@ -1587,7 +1587,7 @@ mod tests { .expect("failed to build base client"); let download_concurrency = Arc::new(Semaphore::new(1)); - let registry = DisplaySafeUrl::parse(&format!("{}/final", &mock_server.uri())).unwrap(); + let registry = DisplaySafeUrl::parse(&format!("{}/final", mock_server.uri())).unwrap(); upload( &group, &form_metadata, @@ -2215,7 +2215,7 @@ mod tests { .and(path("/final")) .respond_with( ResponseTemplate::new(308) - .insert_header("Location", format!("{}/final/", &mock_server.uri())), + .insert_header("Location", format!("{}/final/", mock_server.uri())), ) .mount(&mock_server) .await; @@ -2235,7 +2235,7 @@ mod tests { .and(path("/final")) .respond_with( ResponseTemplate::new(308) - .insert_header("Location", format!("{}/final/", &mock_server.uri())), + .insert_header("Location", format!("{}/final/", mock_server.uri())), ) .mount(&mock_server) .await; @@ -2243,7 +2243,7 @@ mod tests { .and(path("/final/")) .respond_with( ResponseTemplate::new(308) - .insert_header("Location", format!("{}/final", &mock_server.uri())), + .insert_header("Location", format!("{}/final", mock_server.uri())), ) .mount(&mock_server) .await;