Skip to content

Commit

Permalink
Remove trailing commas before brackets (#10740)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh authored Jan 18, 2025
1 parent ae366cc commit c306e46
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion crates/uv-cli/src/comma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()])
);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/uv-client/src/httpcache/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ mod tests {
vec![CacheControlDirective {
name: "max-age".to_string(),
value: b"60".to_vec(),
},]
}]
);
}

Expand Down
6 changes: 3 additions & 3 deletions crates/uv-distribution-types/src/dependency_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions crates/uv-pep440/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions crates/uv-pep508/src/marker/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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());

Expand Down Expand Up @@ -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!(
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-publish/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-python/src/sysconfig/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/uv-resolver/src/pubgrub/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl ReportFormatter<PubGrubPackage, Range<Version>, 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);
Expand Down Expand Up @@ -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!(),
};
Expand All @@ -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!(),
};
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-workspace/src/pyproject_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}
}
6 changes: 3 additions & 3 deletions crates/uv/src/commands/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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() {
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/commands/python/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit c306e46

Please sign in to comment.