diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-05-02 14:37:14 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-05-05 21:30:59 +0100 |
| commit | a744f4aae9ffee9dd246090bef486b09433778d0 (patch) | |
| tree | 5d1083668ec989d1fc8529a7ece60dc2bd4ec594 /src/lib | |
| parent | 0f3969325385f2707e359cb28d9c49c509310452 (diff) | |
chore: nix flake update
update nix dependancies to latest version using default update options
run `cargo clippy --fix` and `cargo fmt` to fix new clippy errors
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/client.rs | 8 | ||||
| -rw-r--r-- | src/lib/git/nostr_url.rs | 2 | ||||
| -rw-r--r-- | src/lib/login/mod.rs | 12 |
3 files changed, 4 insertions, 18 deletions
diff --git a/src/lib/client.rs b/src/lib/client.rs index 478a16a..3f2ae68 100644 --- a/src/lib/client.rs +++ b/src/lib/client.rs | |||
| @@ -968,13 +968,7 @@ async fn create_relays_request( | |||
| 968 | fallback_relays: HashSet<RelayUrl>, | 968 | fallback_relays: HashSet<RelayUrl>, |
| 969 | ) -> Result<FetchRequest> { | 969 | ) -> Result<FetchRequest> { |
| 970 | let repo_ref = if let Some(trusted_maintainer_coordinate) = trusted_maintainer_coordinate { | 970 | let repo_ref = if let Some(trusted_maintainer_coordinate) = trusted_maintainer_coordinate { |
| 971 | if let Ok(repo_ref) = | 971 | (get_repo_ref_from_cache(git_repo_path, trusted_maintainer_coordinate).await).ok() |
| 972 | get_repo_ref_from_cache(git_repo_path, trusted_maintainer_coordinate).await | ||
| 973 | { | ||
| 974 | Some(repo_ref) | ||
| 975 | } else { | ||
| 976 | None | ||
| 977 | } | ||
| 978 | } else { | 972 | } else { |
| 979 | None | 973 | None |
| 980 | }; | 974 | }; |
diff --git a/src/lib/git/nostr_url.rs b/src/lib/git/nostr_url.rs index 54be292..fe58962 100644 --- a/src/lib/git/nostr_url.rs +++ b/src/lib/git/nostr_url.rs | |||
| @@ -327,7 +327,7 @@ impl FromStr for CloneUrl { | |||
| 327 | if s.contains('@') && s | 327 | if s.contains('@') && s |
| 328 | .split('@') | 328 | .split('@') |
| 329 | .nth(0) | 329 | .nth(0) |
| 330 | .map_or(false, |part| !part.contains('/')) { | 330 | .is_some_and(|part| !part.contains('/')) { |
| 331 | "ssh" | 331 | "ssh" |
| 332 | } | 332 | } |
| 333 | // otherwise assume unspecified | 333 | // otherwise assume unspecified |
diff --git a/src/lib/login/mod.rs b/src/lib/login/mod.rs index c37375f..bfc7328 100644 --- a/src/lib/login/mod.rs +++ b/src/lib/login/mod.rs | |||
| @@ -93,11 +93,7 @@ pub async fn get_likely_logged_in_user(git_repo_path: &Path) -> Result<Option<Pu | |||
| 93 | let git_repo = Repo::from_path(&git_repo_path.to_path_buf())?; | 93 | let git_repo = Repo::from_path(&git_repo_path.to_path_buf())?; |
| 94 | Ok( | 94 | Ok( |
| 95 | if let Some(npub) = git_repo.get_git_config_item("nostr.npub", None)? { | 95 | if let Some(npub) = git_repo.get_git_config_item("nostr.npub", None)? { |
| 96 | if let Ok(pubic_key) = PublicKey::parse(&npub) { | 96 | PublicKey::parse(&npub).ok() |
| 97 | Some(pubic_key) | ||
| 98 | } else { | ||
| 99 | None | ||
| 100 | } | ||
| 101 | } else { | 97 | } else { |
| 102 | None | 98 | None |
| 103 | }, | 99 | }, |
| @@ -107,11 +103,7 @@ pub async fn get_likely_logged_in_user(git_repo_path: &Path) -> Result<Option<Pu | |||
| 107 | pub fn get_curent_user(git_repo: &Repo) -> Result<Option<PublicKey>> { | 103 | pub fn get_curent_user(git_repo: &Repo) -> Result<Option<PublicKey>> { |
| 108 | Ok( | 104 | Ok( |
| 109 | if let Some(npub) = git_repo.get_git_config_item("nostr.npub", None)? { | 105 | if let Some(npub) = git_repo.get_git_config_item("nostr.npub", None)? { |
| 110 | if let Ok(public_key) = PublicKey::parse(&npub) { | 106 | PublicKey::parse(&npub).ok() |
| 111 | Some(public_key) | ||
| 112 | } else { | ||
| 113 | None | ||
| 114 | } | ||
| 115 | } else { | 107 | } else { |
| 116 | None | 108 | None |
| 117 | }, | 109 | }, |