Skip to content

Commit dd055e6

Browse files
committed
style: Make clippy happy
1 parent 9ed7b42 commit dd055e6

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

src/bin/set-version/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ pub(crate) use cargo_edit::Error;
66

77
/// User requested to downgrade a crate
88
pub(crate) fn version_downgrade_err(current: impl Display, requested: impl Display) -> Error {
9-
anyhow::format_err!("Cannot downgrade from {} to {}", current, requested)
9+
anyhow::format_err!("Cannot downgrade from {current} to {requested}")
1010
}

src/errors.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,17 @@ impl From<std::io::Error> for CliError {
6767
}
6868

6969
pub(crate) fn non_existent_table_err(table: impl Display) -> Error {
70-
anyhow::format_err!("The table `{}` could not be found.", table)
70+
anyhow::format_err!("The table `{table}` could not be found.")
7171
}
7272

7373
pub(crate) fn non_existent_dependency_err(name: impl Display, table: impl Display) -> Error {
74-
anyhow::format_err!(
75-
"The dependency `{}` could not be found in `{}`.",
76-
name,
77-
table,
78-
)
74+
anyhow::format_err!("The dependency `{name}` could not be found in `{table}`.",)
7975
}
8076

8177
pub(crate) fn unsupported_version_req(req: impl Display) -> Error {
82-
anyhow::format_err!("Support for modifying {} is currently unsupported", req)
78+
anyhow::format_err!("Support for modifying {req} is currently unsupported")
8379
}
8480

8581
pub(crate) fn invalid_release_level(actual: impl Display, version: impl Display) -> Error {
86-
anyhow::format_err!("Cannot increment the {} field for {}", actual, version)
82+
anyhow::format_err!("Cannot increment the {actual} field for {version}")
8783
}

src/registry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ pub fn registry_url(manifest_path: &Path, registry: Option<&str>) -> CargoResult
7373
}
7474
Some(r) => registries
7575
.remove(r)
76-
.with_context(|| anyhow::format_err!("The registry '{}' could not be found", r))?,
76+
.with_context(|| anyhow::format_err!("The registry '{r}' could not be found"))?,
7777
};
7878

7979
// search this linked list and find the tail
8080
while let Some(replace_with) = &source.replace_with {
8181
let is_crates_io = replace_with == CRATES_IO_INDEX;
8282
source = registries.remove(replace_with).with_context(|| {
83-
anyhow::format_err!("The source '{}' could not be found", replace_with)
83+
anyhow::format_err!("The source '{replace_with}' could not be found")
8484
})?;
8585
if is_crates_io {
8686
source

0 commit comments

Comments
 (0)