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/purgatory/sync/functions.rs | |
| 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/purgatory/sync/functions.rs')
| -rw-r--r-- | src/purgatory/sync/functions.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/purgatory/sync/functions.rs b/src/purgatory/sync/functions.rs index 1b9518d..bb7c0b9 100644 --- a/src/purgatory/sync/functions.rs +++ b/src/purgatory/sync/functions.rs | |||
| @@ -35,7 +35,7 @@ fn extract_domain(url: &str) -> Option<String> { | |||
| 35 | let url = url.strip_prefix("https://").or_else(|| url.strip_prefix("http://"))?; | 35 | let url = url.strip_prefix("https://").or_else(|| url.strip_prefix("http://"))?; |
| 36 | 36 | ||
| 37 | // Remove user info if present (e.g., "user@host" -> "host") | 37 | // Remove user info if present (e.g., "user@host" -> "host") |
| 38 | let url = url.split('@').last()?; | 38 | let url = url.split('@').next_back()?; |
| 39 | 39 | ||
| 40 | // Extract host (before first '/' or ':') | 40 | // Extract host (before first '/' or ':') |
| 41 | let host = url.split('/').next()?; | 41 | let host = url.split('/').next()?; |
| @@ -63,7 +63,7 @@ fn extract_domain(url: &str) -> Option<String> { | |||
| 63 | /// * `ctx` - The sync context providing repository data and OID information | 63 | /// * `ctx` - The sync context providing repository data and OID information |
| 64 | /// * `identifier` - The repository identifier (d-tag value) | 64 | /// * `identifier` - The repository identifier (d-tag value) |
| 65 | /// * `domain` - If Some, only return URLs from this specific domain. | 65 | /// * `domain` - If Some, only return URLs from this specific domain. |
| 66 | /// If None, return any non-throttled URL. | 66 | /// If None, return any non-throttled URL. |
| 67 | /// * `tried_urls` - URLs that have already been tried (will be skipped) | 67 | /// * `tried_urls` - URLs that have already been tried (will be skipped) |
| 68 | /// * `throttle_manager` - Used to check if domains are throttled (when domain is None) | 68 | /// * `throttle_manager` - Used to check if domains are throttled (when domain is None) |
| 69 | /// | 69 | /// |
| @@ -126,7 +126,7 @@ pub async fn sync_identifier_next_url<C: SyncContext + ?Sized>( | |||
| 126 | // Merge and filter out our domain | 126 | // Merge and filter out our domain |
| 127 | let all_urls: HashSet<String> = announcement_urls | 127 | let all_urls: HashSet<String> = announcement_urls |
| 128 | .union(&pr_urls) | 128 | .union(&pr_urls) |
| 129 | .filter(|url| our_domain.map_or(true, |d| !url.contains(d))) | 129 | .filter(|url| our_domain.is_none_or(|d| !url.contains(d))) |
| 130 | .cloned() | 130 | .cloned() |
| 131 | .collect(); | 131 | .collect(); |
| 132 | 132 | ||
| @@ -231,7 +231,7 @@ pub async fn get_throttled_domains_with_untried_urls<C: SyncContext + ?Sized>( | |||
| 231 | // Merge and filter out our domain | 231 | // Merge and filter out our domain |
| 232 | let all_urls: HashSet<String> = announcement_urls | 232 | let all_urls: HashSet<String> = announcement_urls |
| 233 | .union(&pr_urls) | 233 | .union(&pr_urls) |
| 234 | .filter(|url| our_domain.map_or(true, |d| !url.contains(d))) | 234 | .filter(|url| our_domain.is_none_or(|d| !url.contains(d))) |
| 235 | .cloned() | 235 | .cloned() |
| 236 | .collect(); | 236 | .collect(); |
| 237 | 237 | ||