Browse Source

aya: fix formatting

Alessandro Decina 3 years ago
parent
commit
d996a88de4
2 changed files with 3 additions and 4 deletions
  1. 1 3
      aya/src/obj/btf/btf.rs
  2. 2 1
      aya/src/programs/socket_filter.rs

+ 1 - 3
aya/src/obj/btf/btf.rs

@@ -214,9 +214,7 @@ impl Btf {
     }
 
     pub(crate) fn type_name(&self, ty: &BtfType) -> Result<Option<Cow<'_, str>>, BtfError> {
-        ty.name_offset()
-            .map(|off| self.string_at(off))
-            .transpose()
+        ty.name_offset().map(|off| self.string_at(off)).transpose()
     }
 
     pub(crate) fn err_type_name(&self, ty: &BtfType) -> Option<String> {

+ 2 - 1
aya/src/programs/socket_filter.rs

@@ -87,7 +87,8 @@ impl SocketFilter {
         if ret < 0 {
             return Err(SocketFilterError::SoAttachBpfError {
                 io_error: io::Error::last_os_error(),
-            }.into());
+            }
+            .into());
         }
 
         Ok(self.data.link(SocketFilterLink {