aya: fix lint errors

pull/239/head
Alessandro Decina 3 years ago
parent 5390fb1ee1
commit 9a642d373f

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

@ -216,7 +216,7 @@ fn relocate_btf_program<'target>(
let access_str = &*local_btf.string_at(rel.access_str_offset)?; 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 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 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) { 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 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(); let (_, target_spec, target_comp_rel) = matches.next().unwrap();
// if there's more than one candidate, make sure that they all resolve to the // if there's more than one candidate, make sure that they all resolve to the

Loading…
Cancel
Save