diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-01 14:31:32 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-01 15:22:38 +0000 |
| commit | d2ac69816567f092fe0d4661723bc43778cb481b (patch) | |
| tree | e8b51b61a6a7b0ab1a214adebe4e237143b01f0b /src/git/mod.rs | |
| parent | 7a78815e29b01c83f3d0ec195ba717a2eba8cd37 (diff) | |
fix cargo clippy and fmt warnings
Diffstat (limited to 'src/git/mod.rs')
| -rw-r--r-- | src/git/mod.rs | 13 |
1 files changed, 7 insertions, 6 deletions
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)> { | |||
| 306 | let subpath = parts[2]; | 306 | let subpath = parts[2]; |
| 307 | 307 | ||
| 308 | // Extract identifier (remove .git suffix if present for the middle part) | 308 | // Extract identifier (remove .git suffix if present for the middle part) |
| 309 | let identifier = if repo_part.ends_with(".git") { | 309 | let identifier = repo_part.strip_suffix(".git").unwrap_or(repo_part); |
| 310 | &repo_part[..repo_part.len() - 4] | ||
| 311 | } else { | ||
| 312 | repo_part | ||
| 313 | }; | ||
| 314 | 310 | ||
| 315 | Some((npub, identifier, subpath)) | 311 | Some((npub, identifier, subpath)) |
| 316 | } | 312 | } |
| @@ -343,7 +339,12 @@ mod tests { | |||
| 343 | 339 | ||
| 344 | // Initialize bare repository | 340 | // Initialize bare repository |
| 345 | Command::new("git") | 341 | Command::new("git") |
| 346 | .args(["init", "--bare", "--initial-branch=main", bare_repo.to_str().unwrap()]) | 342 | .args([ |
| 343 | "init", | ||
| 344 | "--bare", | ||
| 345 | "--initial-branch=main", | ||
| 346 | bare_repo.to_str().unwrap(), | ||
| 347 | ]) | ||
| 347 | .output() | 348 | .output() |
| 348 | .unwrap(); | 349 | .unwrap(); |
| 349 | 350 | ||