From 6c9327cdd6ae5bbf8c6178ee97db1037e97af286 Mon Sep 17 00:00:00 2001 From: Sebastian Zivota Date: Fri, 10 Jan 2025 12:12:56 +0100 Subject: [PATCH] chore: Fix clippy lints (#1587) --- .../symbolicator-native/src/symbolication/symbolicate.rs | 2 +- crates/symbolicator-service/src/download/mod.rs | 2 +- crates/symbolicator-service/src/utils/http.rs | 2 +- crates/symbolicli/src/main.rs | 8 ++++---- crates/symsorter/src/app.rs | 2 +- crates/wasm-split/src/main.rs | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/symbolicator-native/src/symbolication/symbolicate.rs b/crates/symbolicator-native/src/symbolication/symbolicate.rs index c1e2245d5..18f245ef3 100644 --- a/crates/symbolicator-native/src/symbolication/symbolicate.rs +++ b/crates/symbolicator-native/src/symbolication/symbolicate.rs @@ -221,7 +221,7 @@ fn symbolicate_stacktrace( |frame: &SymbolicatedFrame| frame.raw.function.as_deref() == Some("_start"); if status == FrameStatus::UnknownImage && unsymbolicated_frames_iter.peek().is_none() - && symbolicated_frames.last().map_or(false, is_start) + && symbolicated_frames.last().is_some_and(is_start) { continue; } diff --git a/crates/symbolicator-service/src/download/mod.rs b/crates/symbolicator-service/src/download/mod.rs index 4e5051c16..76e08de3e 100644 --- a/crates/symbolicator-service/src/download/mod.rs +++ b/crates/symbolicator-service/src/download/mod.rs @@ -343,7 +343,7 @@ impl DownloadService { && self .host_deny_list .as_ref() - .map_or(false, |deny_list| deny_list.is_blocked(&host)) + .is_some_and(|deny_list| deny_list.is_blocked(&host)) { metric!(counter("service.download.blocked") += 1, "source" => &source_metric_key); return Err(CacheError::DownloadError( diff --git a/crates/symbolicator-service/src/utils/http.rs b/crates/symbolicator-service/src/utils/http.rs index 713398f8e..371e6bab2 100644 --- a/crates/symbolicator-service/src/utils/http.rs +++ b/crates/symbolicator-service/src/utils/http.rs @@ -121,7 +121,7 @@ pub fn create_client( .previous() .last() .and_then(|url| url.host_str()) - .map_or(false, |host| host == "dev.azure.com"); + .is_some_and(|host| host == "dev.azure.com"); if is_from_azure { return attempt.stop(); diff --git a/crates/symbolicli/src/main.rs b/crates/symbolicli/src/main.rs index d91bc9948..4d971408d 100644 --- a/crates/symbolicli/src/main.rs +++ b/crates/symbolicli/src/main.rs @@ -244,7 +244,7 @@ impl Payload { } } - async fn get_remote<'a>(client: &reqwest::Client, key: EventKey<'a>) -> Result { + async fn get_remote(client: &reqwest::Client, key: EventKey<'_>) -> Result { tracing::info!("trying to resolve event remotely"); let event = remote::download_event(client, key).await?; tracing::info!("event json file downloaded"); @@ -290,9 +290,9 @@ mod remote { id: String, } - pub async fn get_attached_minidump<'a>( + pub async fn get_attached_minidump( client: &reqwest::Client, - key: EventKey<'a>, + key: EventKey<'_>, ) -> Result> { let EventKey { base_url, @@ -378,7 +378,7 @@ mod remote { Ok(temp_file.into_temp_path()) } - pub async fn download_event<'a>(client: &reqwest::Client, key: EventKey<'a>) -> Result { + pub async fn download_event(client: &reqwest::Client, key: EventKey<'_>) -> Result { let EventKey { base_url, org, diff --git a/crates/symsorter/src/app.rs b/crates/symsorter/src/app.rs index 73fd6d226..97d114efe 100644 --- a/crates/symsorter/src/app.rs +++ b/crates/symsorter/src/app.rs @@ -196,7 +196,7 @@ fn sort_files(sort_config: &SortConfig, paths: Vec) -> Result<(usize, u .into_iter() .flat_map(WalkDir::new) .filter_map(Result::ok) - .filter(|entry| entry.metadata().ok().map_or(false, |x| x.is_file())) + .filter(|entry| entry.metadata().is_ok_and(|x| x.is_file())) .par_bridge() .map(|entry| { let path = entry.path(); diff --git a/crates/wasm-split/src/main.rs b/crates/wasm-split/src/main.rs index 09ded1b97..1402b06b4 100644 --- a/crates/wasm-split/src/main.rs +++ b/crates/wasm-split/src/main.rs @@ -63,7 +63,7 @@ fn as_custom_section(section: &Section) -> Option<&CustomSection> { /// Returns `true` if this section should be stripped. fn is_strippable_section(section: &Section, strip_names: bool) -> bool { - as_custom_section(section).map_or(false, |section| match section { + as_custom_section(section).is_some_and(|section| match section { CustomSection::Name(_) => strip_names, other => other.name().starts_with(".debug_"), })