From c306e46e1d3342a923ab587a1e9d3313dddb3000 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sat, 18 Jan 2025 14:56:46 -0500 Subject: [PATCH] Remove trailing commas before brackets (#10740) --- crates/uv-cli/src/comma.rs | 2 +- crates/uv-client/src/httpcache/control.rs | 2 +- crates/uv-distribution-types/src/dependency_metadata.rs | 6 +++--- crates/uv-pep440/src/version.rs | 6 +++--- crates/uv-pep508/src/marker/tree.rs | 6 +++--- crates/uv-publish/src/lib.rs | 2 +- crates/uv-python/src/sysconfig/parser.rs | 2 +- crates/uv-resolver/src/pubgrub/report.rs | 6 +++--- crates/uv-workspace/src/pyproject_mut.rs | 2 +- crates/uv/src/commands/diagnostics.rs | 6 +++--- crates/uv/src/commands/python/install.rs | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/crates/uv-cli/src/comma.rs b/crates/uv-cli/src/comma.rs index d1c36c639..b169b56d1 100644 --- a/crates/uv-cli/src/comma.rs +++ b/crates/uv-cli/src/comma.rs @@ -111,7 +111,7 @@ mod tests { fn single_specifiers() { assert_eq!( CommaSeparatedRequirements::from_str("requests>=2.1,<3").unwrap(), - CommaSeparatedRequirements(vec!["requests>=2.1,<3".to_string(),]) + CommaSeparatedRequirements(vec!["requests>=2.1,<3".to_string()]) ); } diff --git a/crates/uv-client/src/httpcache/control.rs b/crates/uv-client/src/httpcache/control.rs index accd11e86..f35850892 100644 --- a/crates/uv-client/src/httpcache/control.rs +++ b/crates/uv-client/src/httpcache/control.rs @@ -695,7 +695,7 @@ mod tests { vec![CacheControlDirective { name: "max-age".to_string(), value: b"60".to_vec(), - },] + }] ); } diff --git a/crates/uv-distribution-types/src/dependency_metadata.rs b/crates/uv-distribution-types/src/dependency_metadata.rs index 70d7b4035..42cc27cc1 100644 --- a/crates/uv-distribution-types/src/dependency_metadata.rs +++ b/crates/uv-distribution-types/src/dependency_metadata.rs @@ -34,17 +34,17 @@ impl DependencyMetadata { .iter() .find(|v| v.version.as_ref() == Some(version)) .inspect(|_| { - debug!("Found dependency metadata entry for `{package}=={version}`",); + debug!("Found dependency metadata entry for `{package}=={version}`"); }) .or_else(|| versions.iter().find(|v| v.version.is_none())) .inspect(|_| { - debug!("Found global metadata entry for `{package}`",); + debug!("Found global metadata entry for `{package}`"); }); let Some(metadata) = metadata else { warn!("No dependency metadata entry found for `{package}=={version}`"); return None; }; - debug!("Found dependency metadata entry for `{package}=={version}`",); + debug!("Found dependency metadata entry for `{package}=={version}`"); Some(ResolutionMetadata { name: metadata.name.clone(), version: version.clone(), diff --git a/crates/uv-pep440/src/version.rs b/crates/uv-pep440/src/version.rs index aaf8dfc1e..bfe16973d 100644 --- a/crates/uv-pep440/src/version.rs +++ b/crates/uv-pep440/src/version.rs @@ -14,7 +14,7 @@ use std::{ #[derive(Eq, Ord, PartialEq, PartialOrd, Debug, Hash, Clone, Copy)] #[cfg_attr( feature = "rkyv", - derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize,) + derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize) )] #[cfg_attr(feature = "rkyv", rkyv(derive(Debug, Eq, PartialEq, PartialOrd, Ord)))] pub enum Operator { @@ -1458,7 +1458,7 @@ impl Deref for Release<'_> { #[derive(PartialEq, Eq, Debug, Hash, Clone, Copy, Ord, PartialOrd)] #[cfg_attr( feature = "rkyv", - derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize,) + derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize) )] #[cfg_attr(feature = "rkyv", rkyv(derive(Debug, Eq, PartialEq, PartialOrd, Ord)))] pub struct Prerelease { @@ -1474,7 +1474,7 @@ pub struct Prerelease { #[derive(PartialEq, Eq, Debug, Hash, Clone, Copy, Ord, PartialOrd)] #[cfg_attr( feature = "rkyv", - derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize,) + derive(rkyv::Archive, rkyv::Deserialize, rkyv::Serialize) )] #[cfg_attr(feature = "rkyv", rkyv(derive(Debug, Eq, PartialEq, PartialOrd, Ord)))] pub enum PrereleaseKind { diff --git a/crates/uv-pep508/src/marker/tree.rs b/crates/uv-pep508/src/marker/tree.rs index 099fdb7e6..2ad48a9ee 100644 --- a/crates/uv-pep508/src/marker/tree.rs +++ b/crates/uv-pep508/src/marker/tree.rs @@ -2890,7 +2890,7 @@ mod test { fn test_is_false() { assert!(m("python_version < '3.10' and python_version >= '3.10'").is_false()); assert!(m("(python_version < '3.10' and python_version >= '3.10') \ - or (python_version < '3.9' and python_version >= '3.9')",) + or (python_version < '3.9' and python_version >= '3.9')") .is_false()); assert!(!m("python_version < '3.10'").is_false()); @@ -3150,7 +3150,7 @@ mod test { assert!(m(" (os_name == 'Linux' and extra == 'foo') - or (os_name != 'Linux' and extra == 'bar')",) + or (os_name != 'Linux' and extra == 'bar')") .without_extras() .is_true()); @@ -3183,7 +3183,7 @@ mod test { ); assert!(m(" (os_name == 'foo' and extra == 'foo') - or (os_name == 'bar' and extra != 'foo')",) + or (os_name == 'bar' and extra != 'foo')") .only_extras() .is_true()); assert_eq!( diff --git a/crates/uv-publish/src/lib.rs b/crates/uv-publish/src/lib.rs index b13ef9e00..19c40abda 100644 --- a/crates/uv-publish/src/lib.rs +++ b/crates/uv-publish/src/lib.rs @@ -397,7 +397,7 @@ pub async fn upload( if UvRetryableStrategy.handle(&result) == Some(Retryable::Transient) { let retry_decision = retry_policy.should_retry(start_time, n_past_retries); if let reqwest_retry::RetryDecision::Retry { execute_after } = retry_decision { - warn_user!("Transient failure while handling response for {registry}; retrying...",); + warn_user!("Transient failure while handling response for {registry}; retrying..."); reporter.on_download_complete(idx); let duration = execute_after .duration_since(SystemTime::now()) diff --git a/crates/uv-python/src/sysconfig/parser.rs b/crates/uv-python/src/sysconfig/parser.rs index 6620459de..f505cc7d0 100644 --- a/crates/uv-python/src/sysconfig/parser.rs +++ b/crates/uv-python/src/sysconfig/parser.rs @@ -56,7 +56,7 @@ impl std::fmt::Display for SysconfigData { self.0.serialize(&mut serializer).unwrap(); String::from_utf8(buf).unwrap() }; - write!(f, "{output}",) + write!(f, "{output}") } } diff --git a/crates/uv-resolver/src/pubgrub/report.rs b/crates/uv-resolver/src/pubgrub/report.rs index cdc2f4351..f3a04a9ab 100644 --- a/crates/uv-resolver/src/pubgrub/report.rs +++ b/crates/uv-resolver/src/pubgrub/report.rs @@ -120,7 +120,7 @@ impl ReportFormatter, UnavailableReason> match reason { UnavailableReason::Package(reason) => { let message = reason.singular_message(); - format!("{}{}", package, Padded::new(" ", &message, ""),) + format!("{}{}", package, Padded::new(" ", &message, "")) } UnavailableReason::Version(reason) => { let range = self.compatible_range(package, set); @@ -1543,7 +1543,7 @@ impl std::fmt::Display for PubGrubHint { let option = match option { NoBuild::All => "for all packages (i.e., with `--no-build`)".to_string(), NoBuild::Packages(_) => { - format!("for `{package}` (i.e., with `--no-build-package {package}`)",) + format!("for `{package}` (i.e., with `--no-build-package {package}`)") } NoBuild::None => unreachable!(), }; @@ -1559,7 +1559,7 @@ impl std::fmt::Display for PubGrubHint { let option = match option { NoBinary::All => "for all packages (i.e., with `--no-binary`)".to_string(), NoBinary::Packages(_) => { - format!("for `{package}` (i.e., with `--no-binary-package {package}`)",) + format!("for `{package}` (i.e., with `--no-binary-package {package}`)") } NoBinary::None => unreachable!(), }; diff --git a/crates/uv-workspace/src/pyproject_mut.rs b/crates/uv-workspace/src/pyproject_mut.rs index 10d7591ed..2b11f5503 100644 --- a/crates/uv-workspace/src/pyproject_mut.rs +++ b/crates/uv-workspace/src/pyproject_mut.rs @@ -1348,7 +1348,7 @@ mod test { split_specifiers("flask[dotenv]>=1.0"), ("flask[dotenv]", ">=1.0") ); - assert_eq!(split_specifiers("flask[dotenv]",), ("flask[dotenv]", "")); + assert_eq!(split_specifiers("flask[dotenv]"), ("flask[dotenv]", "")); assert_eq!(split_specifiers("flask @ https://files.pythonhosted.org/packages/af/47/93213ee66ef8fae3b93b3e29206f6b251e65c97bd91d8e1c5596ef15af0a/flask-3.1.0-py3-none-any.whl"), ("flask", "@ https://files.pythonhosted.org/packages/af/47/93213ee66ef8fae3b93b3e29206f6b251e65c97bd91d8e1c5596ef15af0a/flask-3.1.0-py3-none-any.whl")); } } diff --git a/crates/uv/src/commands/diagnostics.rs b/crates/uv/src/commands/diagnostics.rs index 4331f7562..93ea0cf15 100644 --- a/crates/uv/src/commands/diagnostics.rs +++ b/crates/uv/src/commands/diagnostics.rs @@ -340,7 +340,7 @@ fn format_chain(name: &PackageName, version: Option<&Version>, chain: &Derivatio ) } else { // Ex) `flask>=1.0.0` - format!("`{}{}`", step.name.cyan(), range.cyan(),) + format!("`{}{}`", step.name.cyan(), range.cyan()) } } } else { @@ -354,7 +354,7 @@ fn format_chain(name: &PackageName, version: Option<&Version>, chain: &Derivatio ) } else { // Ex) `flask[dotenv]` - format!("`{}`", format!("{}[{}]", step.name, extra).cyan(),) + format!("`{}`", format!("{}[{}]", step.name, extra).cyan()) } } else if let Some(group) = &step.group { if let Some(version) = step.version.as_ref() { @@ -366,7 +366,7 @@ fn format_chain(name: &PackageName, version: Option<&Version>, chain: &Derivatio ) } else { // Ex) `flask:dev` - format!("`{}`", format!("{}:{}", step.name, group).cyan(),) + format!("`{}`", format!("{}:{}", step.name, group).cyan()) } } else { if let Some(version) = step.version.as_ref() { diff --git a/crates/uv/src/commands/python/install.rs b/crates/uv/src/commands/python/install.rs index e2eb24c93..229fd9bb6 100644 --- a/crates/uv/src/commands/python/install.rs +++ b/crates/uv/src/commands/python/install.rs @@ -217,7 +217,7 @@ pub(crate) async fn install( Either::Left(installation) } } else { - debug!("No installation found for request `{}`", request.cyan(),); + debug!("No installation found for request `{}`", request.cyan()); Either::Right(request) }