diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/client.rs | 3 | ||||
| -rw-r--r-- | src/lib/git/mod.rs | 7 | ||||
| -rw-r--r-- | src/lib/git/nostr_url.rs | 8 | ||||
| -rw-r--r-- | src/lib/login/fresh.rs | 8 |
4 files changed, 11 insertions, 15 deletions
diff --git a/src/lib/client.rs b/src/lib/client.rs index 445bf77..16cfe30 100644 --- a/src/lib/client.rs +++ b/src/lib/client.rs | |||
| @@ -794,8 +794,7 @@ pub async fn sign_event( | |||
| 794 | if signer.backend() == SignerBackend::NostrConnect { | 794 | if signer.backend() == SignerBackend::NostrConnect { |
| 795 | let term = console::Term::stderr(); | 795 | let term = console::Term::stderr(); |
| 796 | term.write_line(&format!( | 796 | term.write_line(&format!( |
| 797 | "signing event ({}) with remote signer...", | 797 | "signing event ({description}) with remote signer..." |
| 798 | description | ||
| 799 | ))?; | 798 | ))?; |
| 800 | let event = signer | 799 | let event = signer |
| 801 | .sign_event(event_builder.build(signer.get_public_key().await?)) | 800 | .sign_event(event_builder.build(signer.get_public_key().await?)) |
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 | } |
diff --git a/src/lib/login/fresh.rs b/src/lib/login/fresh.rs index 683d4af..a169177 100644 --- a/src/lib/login/fresh.rs +++ b/src/lib/login/fresh.rs | |||
| @@ -278,7 +278,7 @@ pub async fn get_fresh_nip46_signer( | |||
| 278 | let input = Interactor::default() | 278 | let input = Interactor::default() |
| 279 | .input( | 279 | .input( |
| 280 | PromptInputParms::default().with_prompt(if let Some(error) = error { | 280 | PromptInputParms::default().with_prompt(if let Some(error) = error { |
| 281 | format!("error: {}. try again with NIP-05 address", error) | 281 | format!("error: {error}. try again with NIP-05 address") |
| 282 | } else { | 282 | } else { |
| 283 | "NIP-05 address".to_string() | 283 | "NIP-05 address".to_string() |
| 284 | }), | 284 | }), |
| @@ -296,7 +296,7 @@ pub async fn get_fresh_nip46_signer( | |||
| 296 | let input = Interactor::default() | 296 | let input = Interactor::default() |
| 297 | .input( | 297 | .input( |
| 298 | PromptInputParms::default().with_prompt(if let Some(error) = error { | 298 | PromptInputParms::default().with_prompt(if let Some(error) = error { |
| 299 | format!("error: {}. try again with bunker url", error) | 299 | format!("error: {error}. try again with bunker url") |
| 300 | } else { | 300 | } else { |
| 301 | "bunker url".to_string() | 301 | "bunker url".to_string() |
| 302 | }), | 302 | }), |
| @@ -505,7 +505,7 @@ async fn save_to_git_config( | |||
| 505 | if let Err(error) = | 505 | if let Err(error) = |
| 506 | silently_save_to_git_config(git_repo, signer_info, global).context(err_msg.clone()) | 506 | silently_save_to_git_config(git_repo, signer_info, global).context(err_msg.clone()) |
| 507 | { | 507 | { |
| 508 | eprintln!("Error: {:?}", error); | 508 | eprintln!("Error: {error:?}"); |
| 509 | match signer_info { | 509 | match signer_info { |
| 510 | SignerInfo::Nsec { | 510 | SignerInfo::Nsec { |
| 511 | nsec, | 511 | nsec, |
| @@ -577,7 +577,7 @@ async fn save_to_git_config( | |||
| 577 | ), | 577 | ), |
| 578 | ) | 578 | ) |
| 579 | { | 579 | { |
| 580 | eprintln!("Error: {:?}", error); | 580 | eprintln!("Error: {error:?}"); |
| 581 | eprintln!("login details were not saved"); | 581 | eprintln!("login details were not saved"); |
| 582 | } else { | 582 | } else { |
| 583 | eprintln!( | 583 | eprintln!( |