diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-12-16 09:00:46 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-12-16 09:46:30 +0000 |
| commit | 4ee83e2fe5335a8afd78439c35f029c4a472e797 (patch) | |
| tree | bdb111b191e7a68cb74ce29b4bb2757b4b7be91f /src/lib/repo_ref.rs | |
| parent | 5fe839e2bf8ceb2931c1984efb2d956980431203 (diff) | |
chore: bump nix flake rust nightly `fmt` overlay
update the rust nightly `fmt` overlay which needs to be pinned
to a specific version (this case by date)
update formatting in main files via `cargo fmt`
Diffstat (limited to 'src/lib/repo_ref.rs')
| -rw-r--r-- | src/lib/repo_ref.rs | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/src/lib/repo_ref.rs b/src/lib/repo_ref.rs index 5d6f4eb..a9d1186 100644 --- a/src/lib/repo_ref.rs +++ b/src/lib/repo_ref.rs | |||
| @@ -6,9 +6,9 @@ use std::{ | |||
| 6 | sync::Arc, | 6 | sync::Arc, |
| 7 | }; | 7 | }; |
| 8 | 8 | ||
| 9 | use anyhow::{bail, Context, Result}; | 9 | use anyhow::{Context, Result, bail}; |
| 10 | use console::Style; | 10 | use console::Style; |
| 11 | use nostr::{nips::nip01::Coordinate, FromBech32, PublicKey, Tag, TagStandard, ToBech32}; | 11 | use nostr::{FromBech32, PublicKey, Tag, TagStandard, ToBech32, nips::nip01::Coordinate}; |
| 12 | use nostr_sdk::{Kind, NostrSigner, RelayUrl, Timestamp}; | 12 | use nostr_sdk::{Kind, NostrSigner, RelayUrl, Timestamp}; |
| 13 | use serde::{Deserialize, Serialize}; | 13 | use serde::{Deserialize, Serialize}; |
| 14 | 14 | ||
| @@ -18,10 +18,10 @@ use crate::{ | |||
| 18 | cli_interactor::{ | 18 | cli_interactor::{ |
| 19 | Interactor, InteractorPrompt, PromptChoiceParms, PromptConfirmParms, PromptInputParms, | 19 | Interactor, InteractorPrompt, PromptChoiceParms, PromptConfirmParms, PromptInputParms, |
| 20 | }, | 20 | }, |
| 21 | client::{consolidate_fetch_reports, get_repo_ref_from_cache, sign_event, Connect}, | 21 | client::{Connect, consolidate_fetch_reports, get_repo_ref_from_cache, sign_event}, |
| 22 | git::{ | 22 | git::{ |
| 23 | nostr_url::{use_nip05_git_config_cache_to_find_nip05_from_public_key, NostrUrlDecoded}, | ||
| 24 | Repo, RepoActions, | 23 | Repo, RepoActions, |
| 24 | nostr_url::{NostrUrlDecoded, use_nip05_git_config_cache_to_find_nip05_from_public_key}, | ||
| 25 | }, | 25 | }, |
| 26 | login::user::get_user_details, | 26 | login::user::get_user_details, |
| 27 | }; | 27 | }; |
| @@ -237,20 +237,17 @@ impl RepoRef { | |||
| 237 | 237 | ||
| 238 | pub fn to_nostr_git_url(&self, git_repo: &Option<&Repo>) -> String { | 238 | pub fn to_nostr_git_url(&self, git_repo: &Option<&Repo>) -> String { |
| 239 | let c = self.coordinate_with_hint(); | 239 | let c = self.coordinate_with_hint(); |
| 240 | format!( | 240 | format!("{}", NostrUrlDecoded { |
| 241 | "{}", | 241 | original_string: String::new(), |
| 242 | NostrUrlDecoded { | 242 | nip05: use_nip05_git_config_cache_to_find_nip05_from_public_key( |
| 243 | original_string: String::new(), | 243 | &c.public_key, |
| 244 | nip05: use_nip05_git_config_cache_to_find_nip05_from_public_key( | 244 | git_repo, |
| 245 | &c.public_key, | 245 | ) |
| 246 | git_repo, | 246 | .unwrap_or_default(), |
| 247 | ) | 247 | coordinate: c, |
| 248 | .unwrap_or_default(), | 248 | protocol: None, |
| 249 | coordinate: c, | 249 | user: None, |
| 250 | protocol: None, | 250 | }) |
| 251 | user: None, | ||
| 252 | } | ||
| 253 | ) | ||
| 254 | } | 251 | } |
| 255 | } | 252 | } |
| 256 | 253 | ||
| @@ -521,14 +518,11 @@ pub fn save_repo_config_to_yaml( | |||
| 521 | .context("failed to convert public key into npub")?, | 518 | .context("failed to convert public key into npub")?, |
| 522 | ); | 519 | ); |
| 523 | } | 520 | } |
| 524 | serde_yaml::to_writer( | 521 | serde_yaml::to_writer(file, &RepoConfigYaml { |
| 525 | file, | 522 | identifier: Some(identifier), |
| 526 | &RepoConfigYaml { | 523 | maintainers: maintainers_npubs, |
| 527 | identifier: Some(identifier), | 524 | relays, |
| 528 | maintainers: maintainers_npubs, | 525 | }) |
| 529 | relays, | ||
| 530 | }, | ||
| 531 | ) | ||
| 532 | .context("failed to write maintainers to maintainers.yaml file serde_yaml") | 526 | .context("failed to write maintainers to maintainers.yaml file serde_yaml") |
| 533 | } | 527 | } |
| 534 | 528 | ||