summaryrefslogtreecommitdiff
path: root/crates/typst-cli/src
diff options
context:
space:
mode:
authordanieleades <33452915+danieleades@users.noreply.github.com>2023-11-27 10:34:14 +0000
committerGitHub <noreply@github.com>2023-11-27 11:34:14 +0100
commite36a18b99135a96bbddbaea33a2116977d04e318 (patch)
tree3365cb450f82a8c9476cbf680cb9c0ef2436aa48 /crates/typst-cli/src
parent3c2b61ee7d312f034109522e90a411c9b920e011 (diff)
Use clippy workspace lints and inline format args (#2771)
Diffstat (limited to 'crates/typst-cli/src')
-rw-r--r--crates/typst-cli/src/download.rs4
-rw-r--r--crates/typst-cli/src/update.rs6
2 files changed, 4 insertions, 6 deletions
diff --git a/crates/typst-cli/src/download.rs b/crates/typst-cli/src/download.rs
index e5a97cda..0fff7b85 100644
--- a/crates/typst-cli/src/download.rs
+++ b/crates/typst-cli/src/download.rs
@@ -198,7 +198,7 @@ impl RemoteReader {
}))
)
}
- None => format!("Total: {} Speed: {} Elapsed: {}", total, speed_h, elapsed,),
+ None => format!("Total: {total} Speed: {speed_h} Elapsed: {elapsed}"),
};
let _ = write!(self.stderr, "{output}");
@@ -252,6 +252,6 @@ fn as_time_unit(size: usize, include_suffix: bool) -> String {
} else if size >= KI {
format!("{:5.1} KiB{}", size / KI, suffix)
} else {
- format!("{size:3.0} B{}", suffix)
+ format!("{size:3.0} B{suffix}")
}
}
diff --git a/crates/typst-cli/src/update.rs b/crates/typst-cli/src/update.rs
index cde77dbb..cfb93454 100644
--- a/crates/typst-cli/src/update.rs
+++ b/crates/typst-cli/src/update.rs
@@ -102,12 +102,10 @@ impl Release {
pub fn from_tag(tag: Option<&Version>) -> StrResult<Release> {
let url = match tag {
Some(tag) => format!(
- "https://api.github.com/repos/{}/{}/releases/tags/v{}",
- TYPST_GITHUB_ORG, TYPST_REPO, tag
+ "https://api.github.com/repos/{TYPST_GITHUB_ORG}/{TYPST_REPO}/releases/tags/v{tag}"
),
None => format!(
- "https://api.github.com/repos/{}/{}/releases/latest",
- TYPST_GITHUB_ORG, TYPST_REPO
+ "https://api.github.com/repos/{TYPST_GITHUB_ORG}/{TYPST_REPO}/releases/latest",
),
};