From e36a18b99135a96bbddbaea33a2116977d04e318 Mon Sep 17 00:00:00 2001 From: danieleades <33452915+danieleades@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:34:14 +0000 Subject: Use clippy workspace lints and inline format args (#2771) --- crates/typst-cli/src/download.rs | 4 ++-- crates/typst-cli/src/update.rs | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'crates/typst-cli/src') 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 { 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", ), }; -- cgit v1.2.3