From 84afa318c84bac92a5cf5b134199dc1875b6706f Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Tue, 19 Jan 2021 07:28:49 +0000 Subject: [PATCH] Formatting fixes --- src/maps/hash_map.rs | 15 ++++++++++++--- src/programs/xdp.rs | 9 +++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/maps/hash_map.rs b/src/maps/hash_map.rs index b313fde4..ad289839 100644 --- a/src/maps/hash_map.rs +++ b/src/maps/hash_map.rs @@ -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)); } diff --git a/src/programs/xdp.rs b/src/programs/xdp.rs index 06228302..6eed0f75 100644 --- a/src/programs/xdp.rs +++ b/src/programs/xdp.rs @@ -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 {