Skip to content

Commit ef8adac

Browse files
committed
fix: Clippy warnings
With the update to libc these functions are no longer marked as unsafe. Updated to remove the unsafe and the wrapper function which is no longer required. Signed-off-by: Jack Thomson <[email protected]>
1 parent ec4b426 commit ef8adac

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/jailer/src/env.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -854,14 +854,6 @@ mod tests {
854854
arg_vec
855855
}
856856

857-
fn get_major(dev: u64) -> u32 {
858-
unsafe { libc::major(dev) }
859-
}
860-
861-
fn get_minor(dev: u64) -> u32 {
862-
unsafe { libc::minor(dev) }
863-
}
864-
865857
fn create_env(mock_proc_mounts: &str) -> Env {
866858
// Create a standard environment.
867859
let arg_parser = build_arg_parser();
@@ -1120,8 +1112,8 @@ mod tests {
11201112
// Ensure device's properties.
11211113
let metadata = fs::metadata(dev_path.to_str().unwrap()).unwrap();
11221114
assert!(metadata.file_type().is_char_device());
1123-
assert_eq!(get_major(metadata.st_rdev()), major);
1124-
assert_eq!(get_minor(metadata.st_rdev()), minor);
1115+
assert_eq!(libc::major(metadata.st_rdev()), major);
1116+
assert_eq!(libc::minor(metadata.st_rdev()), minor);
11251117
assert_eq!(
11261118
metadata.permissions().mode(),
11271119
libc::S_IFCHR | libc::S_IRUSR | libc::S_IWUSR

0 commit comments

Comments
 (0)