From d2ac69816567f092fe0d4661723bc43778cb481b Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 1 Dec 2025 14:31:32 +0000 Subject: fix cargo clippy and fmt warnings --- src/git/mod.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/git/mod.rs') diff --git a/src/git/mod.rs b/src/git/mod.rs index 494f8b9..a783782 100644 --- a/src/git/mod.rs +++ b/src/git/mod.rs @@ -306,11 +306,7 @@ pub fn parse_git_url(path: &str) -> Option<(&str, &str, &str)> { let subpath = parts[2]; // Extract identifier (remove .git suffix if present for the middle part) - let identifier = if repo_part.ends_with(".git") { - &repo_part[..repo_part.len() - 4] - } else { - repo_part - }; + let identifier = repo_part.strip_suffix(".git").unwrap_or(repo_part); Some((npub, identifier, subpath)) } @@ -343,7 +339,12 @@ mod tests { // Initialize bare repository Command::new("git") - .args(["init", "--bare", "--initial-branch=main", bare_repo.to_str().unwrap()]) + .args([ + "init", + "--bare", + "--initial-branch=main", + bare_repo.to_str().unwrap(), + ]) .output() .unwrap(); -- cgit v1.2.3