From 709946c1b49114b71d3080bb8d97e63525f40fd9 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 17 Oct 2025 15:02:53 +0100 Subject: chore: cargo update update patches ahead of wider upgrade. clippy required some autofixes --- src/bin/git_remote_nostr/push.rs | 5 +---- src/bin/ngit/sub_commands/init.rs | 4 ++-- src/lib/git/mod.rs | 5 ++--- src/lib/git/nostr_url.rs | 4 ++-- 4 files changed, 7 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/bin/git_remote_nostr/push.rs b/src/bin/git_remote_nostr/push.rs index fc82796..1645ae8 100644 --- a/src/bin/git_remote_nostr/push.rs +++ b/src/bin/git_remote_nostr/push.rs @@ -1391,10 +1391,7 @@ fn update_remote_refs_pushed( fn refspec_to_from_to(refspec: &str) -> Result<(&str, &str)> { if !refspec.contains(':') { - bail!( - "refspec should contain a colon (:) but consists of: {}", - refspec - ); + bail!("refspec should contain a colon (:) but consists of: {refspec}"); } let parts = refspec.split(':').collect::>(); Ok(( diff --git a/src/bin/ngit/sub_commands/init.rs b/src/bin/ngit/sub_commands/init.rs index e28268d..39fe670 100644 --- a/src/bin/ngit/sub_commands/init.rs +++ b/src/bin/ngit/sub_commands/init.rs @@ -1055,7 +1055,7 @@ fn push_main_or_master_branch(git_repo: &Repo) -> Result<()> { if exit_status.success() { Ok(()) } else { - bail!("git push process exited with an error: {}", exit_status); + bail!("git push process exited with an error: {exit_status}"); } } @@ -1086,6 +1086,6 @@ fn run_ngit_sync() -> Result<()> { if exit_status.success() { Ok(()) } else { - bail!("ngit sync process exited with an error: {}", exit_status); + bail!("ngit sync process exited with an error: {exit_status}"); } } diff --git a/src/lib/git/mod.rs b/src/lib/git/mod.rs index 06573eb..b9711ae 100644 --- a/src/lib/git/mod.rs +++ b/src/lib/git/mod.rs @@ -459,8 +459,7 @@ impl RepoActions for Repo { }) { None => { bail!(format!( - "{} is not an ancestor of {}", - latest_commit, base_commit + "{latest_commit} is not an ancestor of {base_commit}" )); } Some(res) => res.context("revwalk failed to reveal commit")?, @@ -671,7 +670,7 @@ impl RepoActions for Repo { if !applied_oid.to_string().eq(commit_id) { bail!( "when applied the patch commit id ({}) doesn't match the one specified in the event tag ({})", - applied_oid.to_string(), + applied_oid, get_commit_id_from_patch(patch)?, ); } diff --git a/src/lib/git/nostr_url.rs b/src/lib/git/nostr_url.rs index 0a8338a..23c98e7 100644 --- a/src/lib/git/nostr_url.rs +++ b/src/lib/git/nostr_url.rs @@ -543,7 +543,7 @@ pub fn convert_clone_url_to_https(url: &str) -> Result { // Construct the HTTPS URL return Ok(format!("https://{}/{}", parts[0], parts[1..].join("/"))); } - bail!("Invalid SSH URL format: {}", url); + bail!("Invalid SSH URL format: {url}"); } // Convert ftp:// to https:// else if stripped_url.starts_with("ftp://") { @@ -555,7 +555,7 @@ pub fn convert_clone_url_to_https(url: &str) -> Result { } // If the URL is neither HTTPS, SSH, nor git@, return an error - bail!("Unsupported URL protocol: {}", url); + bail!("Unsupported URL protocol: {url}"); } // Function to strip username and password from the URL -- cgit v1.2.3