From 42bf1196003c0b39179d8c9d2c07ecf9a83a4a74 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Wed, 7 Jan 2026 17:16:37 +0000 Subject: 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(...) --- src/purgatory/sync/functions.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/purgatory/sync/functions.rs') 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 { let url = url.strip_prefix("https://").or_else(|| url.strip_prefix("http://"))?; // Remove user info if present (e.g., "user@host" -> "host") - let url = url.split('@').last()?; + let url = url.split('@').next_back()?; // Extract host (before first '/' or ':') let host = url.split('/').next()?; @@ -63,7 +63,7 @@ fn extract_domain(url: &str) -> Option { /// * `ctx` - The sync context providing repository data and OID information /// * `identifier` - The repository identifier (d-tag value) /// * `domain` - If Some, only return URLs from this specific domain. -/// If None, return any non-throttled URL. +/// If None, return any non-throttled URL. /// * `tried_urls` - URLs that have already been tried (will be skipped) /// * `throttle_manager` - Used to check if domains are throttled (when domain is None) /// @@ -126,7 +126,7 @@ pub async fn sync_identifier_next_url( // Merge and filter out our domain let all_urls: HashSet = announcement_urls .union(&pr_urls) - .filter(|url| our_domain.map_or(true, |d| !url.contains(d))) + .filter(|url| our_domain.is_none_or(|d| !url.contains(d))) .cloned() .collect(); @@ -231,7 +231,7 @@ pub async fn get_throttled_domains_with_untried_urls( // Merge and filter out our domain let all_urls: HashSet = announcement_urls .union(&pr_urls) - .filter(|url| our_domain.map_or(true, |d| !url.contains(d))) + .filter(|url| our_domain.is_none_or(|d| !url.contains(d))) .cloned() .collect(); -- cgit v1.2.3