mirror of
https://github.com/astral-sh/uv
synced 2026-06-21 13:47:25 +00:00
Fix Clippy warnings in nightly check (#19861)
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -291,7 +291,7 @@ impl From<GitUrl> 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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user