diff options
| author | danieleades <33452915+danieleades@users.noreply.github.com> | 2023-11-27 10:34:14 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-27 11:34:14 +0100 |
| commit | e36a18b99135a96bbddbaea33a2116977d04e318 (patch) | |
| tree | 3365cb450f82a8c9476cbf680cb9c0ef2436aa48 /crates/typst-cli | |
| parent | 3c2b61ee7d312f034109522e90a411c9b920e011 (diff) | |
Use clippy workspace lints and inline format args (#2771)
Diffstat (limited to 'crates/typst-cli')
| -rw-r--r-- | crates/typst-cli/Cargo.toml | 3 | ||||
| -rw-r--r-- | crates/typst-cli/src/download.rs | 4 | ||||
| -rw-r--r-- | crates/typst-cli/src/update.rs | 6 |
3 files changed, 7 insertions, 6 deletions
diff --git a/crates/typst-cli/Cargo.toml b/crates/typst-cli/Cargo.toml index 3819469e..1854e856 100644 --- a/crates/typst-cli/Cargo.toml +++ b/crates/typst-cli/Cargo.toml @@ -74,3 +74,6 @@ embed-fonts = [] # Permits the CLI to update itself without a package manager self-update = ["dep:self-replace", "dep:xz2", "dep:zip", "ureq/json"] + +[lints] +workspace = true 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", ), }; |
