diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-09-11 12:52:46 +0100 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-09-11 13:05:57 +0100 |
| commit | df1660b1b78b5881c64c6fadd4ae12c8c01c6684 (patch) | |
| tree | 044bcfc85d3cffe3ede73e1285cacaf30aaa981d | |
| parent | db17699af4b0ec839b8340766aab91bacf974cd4 (diff) | |
refactor: fix fmt and clippy issues
which potentially were only identified when a dependancy was updated
| -rw-r--r-- | src/lib/client.rs | 2 | ||||
| -rw-r--r-- | src/lib/git/mod.rs | 6 | ||||
| -rw-r--r-- | src/lib/git_events.rs | 2 | ||||
| -rw-r--r-- | test_utils/src/lib.rs | 2 | ||||
| -rw-r--r-- | tests/git_remote_nostr/fetch.rs | 1 | ||||
| -rw-r--r-- | tests/git_remote_nostr/list.rs | 1 | ||||
| -rw-r--r-- | tests/ngit/list.rs | 8 |
7 files changed, 8 insertions, 14 deletions
diff --git a/src/lib/client.rs b/src/lib/client.rs index c29d4b9..455725c 100644 --- a/src/lib/client.rs +++ b/src/lib/client.rs | |||
| @@ -145,7 +145,7 @@ impl Connect for Client { | |||
| 145 | Client { | 145 | Client { |
| 146 | client: nostr_sdk::ClientBuilder::new() | 146 | client: nostr_sdk::ClientBuilder::new() |
| 147 | .opts(Options::new().relay_limits(RelayLimits::disable())) | 147 | .opts(Options::new().relay_limits(RelayLimits::disable())) |
| 148 | .signer(&opts.keys.unwrap_or(nostr::Keys::generate())) | 148 | .signer(opts.keys.unwrap_or(nostr::Keys::generate())) |
| 149 | // .database( | 149 | // .database( |
| 150 | // SQLiteDatabase::open(get_dirs()?.cache_dir().join("nostr-cache.sqlite")). | 150 | // SQLiteDatabase::open(get_dirs()?.cache_dir().join("nostr-cache.sqlite")). |
| 151 | // await?, ) | 151 | // await?, ) |
diff --git a/src/lib/git/mod.rs b/src/lib/git/mod.rs index 72717f7..00d84f6 100644 --- a/src/lib/git/mod.rs +++ b/src/lib/git/mod.rs | |||
| @@ -685,11 +685,7 @@ impl RepoActions for Repo { | |||
| 685 | /// setting global to None will suppliment local config with global items | 685 | /// setting global to None will suppliment local config with global items |
| 686 | /// not in local | 686 | /// not in local |
| 687 | fn get_git_config_item(&self, item: &str, global: Option<bool>) -> Result<Option<String>> { | 687 | fn get_git_config_item(&self, item: &str, global: Option<bool>) -> Result<Option<String>> { |
| 688 | let just_global = if let Some(just_global) = global { | 688 | let just_global = global.unwrap_or(false); |
| 689 | just_global | ||
| 690 | } else { | ||
| 691 | false | ||
| 692 | }; | ||
| 693 | match if just_global { | 689 | match if just_global { |
| 694 | self.git_repo | 690 | self.git_repo |
| 695 | .config() | 691 | .config() |
diff --git a/src/lib/git_events.rs b/src/lib/git_events.rs index 2e9f797..b4ac676 100644 --- a/src/lib/git_events.rs +++ b/src/lib/git_events.rs | |||
| @@ -249,7 +249,7 @@ pub fn event_tag_from_nip19_or_hex( | |||
| 249 | loop { | 249 | loop { |
| 250 | if bech32.is_empty() { | 250 | if bech32.is_empty() { |
| 251 | bech32 = Interactor::default().input( | 251 | bech32 = Interactor::default().input( |
| 252 | PromptInputParms::default().with_prompt(&format!("{reference_name} reference")), | 252 | PromptInputParms::default().with_prompt(format!("{reference_name} reference")), |
| 253 | )?; | 253 | )?; |
| 254 | } | 254 | } |
| 255 | if let Ok(nip19) = Nip19::from_bech32(bech32.clone()) { | 255 | if let Ok(nip19) = Nip19::from_bech32(bech32.clone()) { |
diff --git a/test_utils/src/lib.rs b/test_utils/src/lib.rs index deff86e..be51ed9 100644 --- a/test_utils/src/lib.rs +++ b/test_utils/src/lib.rs | |||
| @@ -1024,7 +1024,7 @@ where | |||
| 1024 | for entry in (std::fs::read_dir(src)?).flatten() { | 1024 | for entry in (std::fs::read_dir(src)?).flatten() { |
| 1025 | let src_path = entry.path(); | 1025 | let src_path = entry.path(); |
| 1026 | if let Some(name) = src_path.file_name() { | 1026 | if let Some(name) = src_path.file_name() { |
| 1027 | let _ = std::fs::copy(&src_path, &git_exec_dir.join(name)); | 1027 | let _ = std::fs::copy(&src_path, git_exec_dir.join(name)); |
| 1028 | } | 1028 | } |
| 1029 | } | 1029 | } |
| 1030 | } | 1030 | } |
diff --git a/tests/git_remote_nostr/fetch.rs b/tests/git_remote_nostr/fetch.rs index 9ae17d8..b7415b5 100644 --- a/tests/git_remote_nostr/fetch.rs +++ b/tests/git_remote_nostr/fetch.rs | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | |||
| 2 | use super::*; | 1 | use super::*; |
| 3 | 2 | ||
| 4 | #[tokio::test] | 3 | #[tokio::test] |
diff --git a/tests/git_remote_nostr/list.rs b/tests/git_remote_nostr/list.rs index 1b12bbd..3858ece 100644 --- a/tests/git_remote_nostr/list.rs +++ b/tests/git_remote_nostr/list.rs | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | |||
| 2 | use super::*; | 1 | use super::*; |
| 3 | 2 | ||
| 4 | mod without_state_announcement { | 3 | mod without_state_announcement { |
diff --git a/tests/ngit/list.rs b/tests/ngit/list.rs index c145fa4..26cf717 100644 --- a/tests/ngit/list.rs +++ b/tests/ngit/list.rs | |||
| @@ -196,7 +196,7 @@ mod when_main_branch_is_uptodate { | |||
| 196 | ], | 196 | ], |
| 197 | )?; | 197 | )?; |
| 198 | c.succeeds_with(0, false, None)?; | 198 | c.succeeds_with(0, false, None)?; |
| 199 | p.expect(&format!( | 199 | p.expect(format!( |
| 200 | "checked out proposal as 'pr/{}(", | 200 | "checked out proposal as 'pr/{}(", |
| 201 | FEATURE_BRANCH_NAME_1, | 201 | FEATURE_BRANCH_NAME_1, |
| 202 | ))?; | 202 | ))?; |
| @@ -318,7 +318,7 @@ mod when_main_branch_is_uptodate { | |||
| 318 | ], | 318 | ], |
| 319 | )?; | 319 | )?; |
| 320 | c.succeeds_with(0, false, Some(0))?; | 320 | c.succeeds_with(0, false, Some(0))?; |
| 321 | p.expect(&format!( | 321 | p.expect(format!( |
| 322 | "checked out proposal as 'pr/{}(", | 322 | "checked out proposal as 'pr/{}(", |
| 323 | FEATURE_BRANCH_NAME_3, | 323 | FEATURE_BRANCH_NAME_3, |
| 324 | ))?; | 324 | ))?; |
| @@ -525,7 +525,7 @@ mod when_main_branch_is_uptodate { | |||
| 525 | ], | 525 | ], |
| 526 | )?; | 526 | )?; |
| 527 | c.succeeds_with(0, false, Some(0))?; | 527 | c.succeeds_with(0, false, Some(0))?; |
| 528 | p.expect(&format!( | 528 | p.expect(format!( |
| 529 | "checked out proposal as 'pr/{}(", | 529 | "checked out proposal as 'pr/{}(", |
| 530 | FEATURE_BRANCH_NAME_4, | 530 | FEATURE_BRANCH_NAME_4, |
| 531 | ))?; | 531 | ))?; |
| @@ -772,7 +772,7 @@ mod when_main_branch_is_uptodate { | |||
| 772 | ], | 772 | ], |
| 773 | )?; | 773 | )?; |
| 774 | c.succeeds_with(0, false, Some(0))?; | 774 | c.succeeds_with(0, false, Some(0))?; |
| 775 | p.expect(&format!( | 775 | p.expect(format!( |
| 776 | "checked out proposal as 'pr/{}(", | 776 | "checked out proposal as 'pr/{}(", |
| 777 | FEATURE_BRANCH_NAME_1, | 777 | FEATURE_BRANCH_NAME_1, |
| 778 | ))?; | 778 | ))?; |