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);