diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-07 17:16:37 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-07 17:16:37 +0000 |
| commit | 42bf1196003c0b39179d8c9d2c07ecf9a83a4a74 (patch) | |
| tree | d276dc3ac0e904f595d7ce88c30751112439311c /src/git | |
| parent | b71111cc25b99acab786ece4607cb60e9cbebae4 (diff) | |
fix: resolve clippy warnings
- Prefix unused variable auth_result with underscore
- Prefix unused field git_data_path with underscore in Purgatory struct
- Add #[allow(clippy::too_many_arguments)] to handle_receive_pack
- Replace len() >= 1 with !is_empty()
- Replace .last() with .next_back() on DoubleEndedIterator
- Fix doc list item overindentation
- Replace map_or(true, ...) with is_none_or(...)
- Replace map_or(false, ...) with is_some_and(...)
Diffstat (limited to 'src/git')
| -rw-r--r-- | src/git/handlers.rs | 3 | ||||
| -rw-r--r-- | src/git/sync.rs | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/git/handlers.rs b/src/git/handlers.rs index 6d2e2d7..ff55e34 100644 --- a/src/git/handlers.rs +++ b/src/git/handlers.rs | |||
| @@ -181,6 +181,7 @@ pub async fn handle_upload_pack( | |||
| 181 | /// * `identifier` - The repository identifier (d tag) for authorization lookup | 181 | /// * `identifier` - The repository identifier (d tag) for authorization lookup |
| 182 | /// * `owner_pubkey` - The owner's public key (hex) from the URL path, scoping authorization | 182 | /// * `owner_pubkey` - The owner's public key (hex) from the URL path, scoping authorization |
| 183 | /// * `git_data_path` - Base path for git repositories (for syncing to other owner repos) | 183 | /// * `git_data_path` - Base path for git repositories (for syncing to other owner repos) |
| 184 | #[allow(clippy::too_many_arguments)] | ||
| 184 | pub async fn handle_receive_pack( | 185 | pub async fn handle_receive_pack( |
| 185 | repo_path: PathBuf, | 186 | repo_path: PathBuf, |
| 186 | request_body: Bytes, | 187 | request_body: Bytes, |
| @@ -204,7 +205,7 @@ pub async fn handle_receive_pack( | |||
| 204 | ); | 205 | ); |
| 205 | 206 | ||
| 206 | // check push is authorised | 207 | // check push is authorised |
| 207 | let auth_result = match authorize_push( | 208 | let _auth_result = match authorize_push( |
| 208 | &database, | 209 | &database, |
| 209 | identifier, | 210 | identifier, |
| 210 | owner_pubkey, | 211 | owner_pubkey, |
diff --git a/src/git/sync.rs b/src/git/sync.rs index 949d8e1..2f43e6e 100644 --- a/src/git/sync.rs +++ b/src/git/sync.rs | |||
| @@ -1310,7 +1310,7 @@ async fn process_purgatory_pr_events( | |||
| 1310 | fn extract_owner_from_repo_path(repo_path: &Path, git_data_path: &Path) -> Option<String> { | 1310 | fn extract_owner_from_repo_path(repo_path: &Path, git_data_path: &Path) -> Option<String> { |
| 1311 | let relative = repo_path.strip_prefix(git_data_path).ok()?; | 1311 | let relative = repo_path.strip_prefix(git_data_path).ok()?; |
| 1312 | let components: Vec<_> = relative.components().collect(); | 1312 | let components: Vec<_> = relative.components().collect(); |
| 1313 | if components.len() >= 1 { | 1313 | if !components.is_empty() { |
| 1314 | components[0].as_os_str().to_str().map(|s| s.to_string()) | 1314 | components[0].as_os_str().to_str().map(|s| s.to_string()) |
| 1315 | } else { | 1315 | } else { |
| 1316 | None | 1316 | None |