Răsfoiți Sursa

Fix clippy warnings

Signed-off-by: Michal Rostecki <vadorovsky@gmail.com>
Michal Rostecki 2 ani în urmă
părinte
comite
5a4b5ff8d8
2 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 1 1
      aya/src/obj/relocation.rs
  2. 1 1
      aya/src/sys/perf_event.rs

+ 1 - 1
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,

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