浏览代码

Clean up C type imports

Tamir Duberstein 3 月之前
父节点
当前提交
4257643354
共有 2 个文件被更改,包括 4 次插入6 次删除
  1. 2 4
      aya/src/bpf.rs
  2. 2 2
      aya/src/maps/mod.rs

+ 2 - 4
aya/src/bpf.rs

@@ -1,11 +1,9 @@
 use std::{
     borrow::Cow,
     collections::{HashMap, HashSet},
+    ffi::c_int,
     fs, io,
-    os::{
-        fd::{AsFd as _, AsRawFd as _},
-        raw::c_int,
-    },
+    os::fd::{AsFd as _, AsRawFd as _},
     path::{Path, PathBuf},
     sync::{Arc, LazyLock},
 };

+ 2 - 2
aya/src/maps/mod.rs

@@ -1012,10 +1012,10 @@ mod test_utils {
 
 #[cfg(test)]
 mod tests {
-    use std::os::fd::AsRawFd as _;
+    use std::{ffi::c_char, os::fd::AsRawFd as _};
 
     use assert_matches::assert_matches;
-    use libc::{c_char, EFAULT};
+    use libc::EFAULT;
 
     fn new_obj_map() -> obj::Map {
         test_utils::new_obj_map::<u32>(crate::generated::bpf_map_type::BPF_MAP_TYPE_HASH)