Formatting fixes

pull/1/head
Alessandro Decina 4 years ago
parent 15be301f8c
commit 84afa318c8

@ -592,7 +592,10 @@ mod tests {
let mut keys = unsafe { hm.keys() };
assert!(matches!(keys.next(), Some(Ok(10))));
assert!(matches!(keys.next(), Some(Ok(20))));
assert!(matches!(keys.next(), Some(Err(MapError::GetNextKeyFailed { .. }))));
assert!(matches!(
keys.next(),
Some(Err(MapError::GetNextKeyFailed { .. }))
));
assert!(matches!(keys.next(), None));
}
@ -683,7 +686,10 @@ mod tests {
let mut iter = unsafe { hm.iter() };
assert!(matches!(iter.next(), Some(Ok((10, 100)))));
assert!(matches!(iter.next(), Some(Ok((20, 200)))));
assert!(matches!(iter.next(), Some(Err(MapError::GetNextKeyFailed { .. }))));
assert!(matches!(
iter.next(),
Some(Err(MapError::GetNextKeyFailed { .. }))
));
assert!(matches!(iter.next(), None));
}
@ -718,7 +724,10 @@ mod tests {
let mut iter = unsafe { hm.iter() };
assert!(matches!(iter.next(), Some(Ok((10, 100)))));
assert!(matches!(iter.next(), Some(Err(MapError::LookupElementFailed { .. }))));
assert!(matches!(
iter.next(),
Some(Err(MapError::LookupElementFailed { .. }))
));
assert!(matches!(iter.next(), Some(Ok((30, 300)))));
assert!(matches!(iter.next(), None));
}

@ -2,11 +2,12 @@ use std::ffi::CString;
use libc::if_nametoindex;
use crate::generated::{bpf_attach_type::BPF_XDP, bpf_prog_type::BPF_PROG_TYPE_XDP};
use crate::syscalls::bpf_link_create;
use crate::RawFd;
use super::{load_program, ProgramData, ProgramError};
use crate::{
generated::{bpf_attach_type::BPF_XDP, bpf_prog_type::BPF_PROG_TYPE_XDP},
programs::{load_program, ProgramData, ProgramError},
syscalls::bpf_link_create,
};
#[derive(Debug)]
pub struct Xdp {

Loading…
Cancel
Save