diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-07-16 10:10:41 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-07-16 10:39:35 +0100 |
| commit | 092b9606ff2b721d858a5c7b2b27a2f9942b4bc4 (patch) | |
| tree | 29022aee83ac0460098dfdbd4362ef75388c4ea7 /src/lib/git | |
| parent | 6e041a3626f04e591d5c22f71d3e4ab2b03bd7bb (diff) | |
chore: nix flake update
required running:
`cargo fix --allow-dirty --allow-staged`
`cargo clippy --fix --allow-dirty -- -D warnings`
to fix problems
and then manually fixing some too
Diffstat (limited to 'src/lib/git')
| -rw-r--r-- | src/lib/git/mod.rs | 7 | ||||
| -rw-r--r-- | src/lib/git/nostr_url.rs | 8 |
2 files changed, 6 insertions, 9 deletions
diff --git a/src/lib/git/mod.rs b/src/lib/git/mod.rs index 5bdb30a..464990b 100644 --- a/src/lib/git/mod.rs +++ b/src/lib/git/mod.rs | |||
| @@ -888,7 +888,7 @@ pub fn save_git_config_item(git_repo: &Option<&Repo>, item: &str, value: &str) - | |||
| 888 | git2::Config::open_default()? | 888 | git2::Config::open_default()? |
| 889 | .open_global()? | 889 | .open_global()? |
| 890 | .set_str(item, value) | 890 | .set_str(item, value) |
| 891 | .context(format!("failed to set global git config item {}", item)) | 891 | .context(format!("failed to set global git config item {item}")) |
| 892 | } | 892 | } |
| 893 | } | 893 | } |
| 894 | 894 | ||
| @@ -901,10 +901,7 @@ pub fn remove_git_config_item(git_repo: &Option<&Repo>, item: &str) -> Result<bo | |||
| 901 | git2::Config::open_default()? | 901 | git2::Config::open_default()? |
| 902 | .open_global()? | 902 | .open_global()? |
| 903 | .remove(item) | 903 | .remove(item) |
| 904 | .context(format!( | 904 | .context(format!("failed to remove existing git config item {item}"))?; |
| 905 | "failed to remove existing git config item {}", | ||
| 906 | item | ||
| 907 | ))?; | ||
| 908 | Ok(true) | 905 | Ok(true) |
| 909 | } | 906 | } |
| 910 | } | 907 | } |
diff --git a/src/lib/git/nostr_url.rs b/src/lib/git/nostr_url.rs index a9b08eb..e9b482f 100644 --- a/src/lib/git/nostr_url.rs +++ b/src/lib/git/nostr_url.rs | |||
| @@ -71,13 +71,13 @@ impl fmt::Display for NostrUrlDecoded { | |||
| 71 | } | 71 | } |
| 72 | write!(f, "nostr://")?; | 72 | write!(f, "nostr://")?; |
| 73 | if let Some(user) = &self.user { | 73 | if let Some(user) = &self.user { |
| 74 | write!(f, "{}@", user)?; | 74 | write!(f, "{user}@")?; |
| 75 | } | 75 | } |
| 76 | if let Some(protocol) = &self.protocol { | 76 | if let Some(protocol) = &self.protocol { |
| 77 | write!(f, "{}/", protocol)?; | 77 | write!(f, "{protocol}/")?; |
| 78 | } | 78 | } |
| 79 | if let Some(nip05) = &self.nip05 { | 79 | if let Some(nip05) = &self.nip05 { |
| 80 | write!(f, "{}/", nip05)?; | 80 | write!(f, "{nip05}/")?; |
| 81 | } else { | 81 | } else { |
| 82 | write!(f, "{}/", self.coordinate.public_key.to_bech32().unwrap())?; | 82 | write!(f, "{}/", self.coordinate.public_key.to_bech32().unwrap())?; |
| 83 | } | 83 | } |
| @@ -454,7 +454,7 @@ impl CloneUrl { | |||
| 454 | format!("{}@", user.as_deref().unwrap_or("git")).as_str(), | 454 | format!("{}@", user.as_deref().unwrap_or("git")).as_str(), |
| 455 | ); | 455 | ); |
| 456 | if url.port().is_some() { | 456 | if url.port().is_some() { |
| 457 | formatted_url = format!("ssh://{}", formatted_url); | 457 | formatted_url = format!("ssh://{formatted_url}"); |
| 458 | } else { | 458 | } else { |
| 459 | formatted_url = replace_first_occurrence(&formatted_url, '/', ':'); | 459 | formatted_url = replace_first_occurrence(&formatted_url, '/', ':'); |
| 460 | } | 460 | } |