Răsfoiți Sursa

aya: fix lint errors

Alessandro Decina 3 ani în urmă
părinte
comite
9a642d373f
2 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 1 1
      aya/src/maps/stack_trace.rs
  2. 2 2
      aya/src/obj/btf/relocation.rs

+ 1 - 1
aya/src/maps/stack_trace.rs

@@ -124,7 +124,7 @@ impl<T: Deref<Target = Map>> StackTraceMap<T> {
             .ok_or(MapError::KeyNotFound)?;
 
         let frames = frames
-            .drain(..)
+            .into_iter()
             .take_while(|ip| *ip != 0)
             .map(|ip| StackFrame {
                 ip,

+ 2 - 2
aya/src/obj/btf/relocation.rs

@@ -216,7 +216,7 @@ fn relocate_btf_program<'target>(
         let access_str = &*local_btf.string_at(rel.access_str_offset)?;
         let local_spec = AccessSpec::new(local_btf, rel.type_id, access_str, *rel)?;
 
-        let mut matches = match rel.kind {
+        let matches = match rel.kind {
             RelocationKind::TypeIdLocal => Vec::new(), // we don't need to look at target types to relocate this value
             _ => {
                 let candidates = match candidates_cache.get(&rel.type_id) {
@@ -244,7 +244,7 @@ fn relocate_btf_program<'target>(
         };
 
         let comp_rel = if !matches.is_empty() {
-            let mut matches = matches.drain(..);
+            let mut matches = matches.into_iter();
             let (_, target_spec, target_comp_rel) = matches.next().unwrap();
 
             // if there's more than one candidate, make sure that they all resolve to the