From 5a4b5ff8d8bf8d3f36cb784d9e3af5284e388433 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Mon, 19 Sep 2022 09:02:26 +0200 Subject: [PATCH] Fix clippy warnings Signed-off-by: Michal Rostecki --- aya/src/obj/relocation.rs | 2 +- aya/src/sys/perf_event.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aya/src/obj/relocation.rs b/aya/src/obj/relocation.rs index 978faab8..4be758ff 100644 --- a/aya/src/obj/relocation.rs +++ b/aya/src/obj/relocation.rs @@ -22,7 +22,7 @@ enum RelocationError { UnknownSymbol { index: usize }, #[error("section `{section_index}` not found, referenced by symbol `{}` #{symbol_index}", - .symbol_name.clone().unwrap_or_else(|| "".to_string()))] + .symbol_name.clone().unwrap_or_default())] SectionNotFound { section_index: usize, symbol_index: usize, diff --git a/aya/src/sys/perf_event.rs b/aya/src/sys/perf_event.rs index 346fea2b..68eddd35 100644 --- a/aya/src/sys/perf_event.rs +++ b/aya/src/sys/perf_event.rs @@ -30,7 +30,7 @@ pub(crate) fn perf_event_open( attr.type_ = perf_type; attr.sample_type = PERF_SAMPLE_RAW as u64; // attr.inherits = if pid > 0 { 1 } else { 0 }; - attr.__bindgen_anon_2.wakeup_events = if wakeup { 1 } else { 0 }; + attr.__bindgen_anon_2.wakeup_events = u32::from(wakeup); if let Some(frequency) = sample_frequency { attr.set_freq(1);