ksud: rust FMT

This commit is contained in:
Rifat Azad
2025-06-25 13:25:28 +06:00
parent 39f20bf573
commit 78eb3b0b22
20 changed files with 45 additions and 53 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
use anyhow::{Context, Error, Ok, Result, bail};
use anyhow::{bail, Context, Error, Ok, Result};
use std::{
fs::{File, OpenOptions, create_dir_all, remove_file, write},
fs::{create_dir_all, remove_file, write, File, OpenOptions},
io::{
ErrorKind::{AlreadyExists, NotFound},
Write,
@@ -11,7 +11,7 @@ use std::{
use crate::{assets, boot_patch, defs, ksucalls, module, restorecon};
#[allow(unused_imports)]
use std::fs::{Permissions, set_permissions};
use std::fs::{set_permissions, Permissions};
#[cfg(unix)]
use std::os::unix::prelude::PermissionsExt;
@@ -20,7 +20,7 @@ use std::path::PathBuf;
#[cfg(any(target_os = "linux", target_os = "android"))]
use rustix::{
process,
thread::{LinkNameSpaceType, move_into_link_name_space},
thread::{move_into_link_name_space, LinkNameSpaceType},
};
pub fn ensure_clean_dir(dir: impl AsRef<Path>) -> Result<()> {
@@ -125,7 +125,7 @@ pub fn get_zip_uncompressed_size(zip_path: &str) -> Result<u64> {
pub fn switch_mnt_ns(pid: i32) -> Result<()> {
use rustix::{
fd::AsFd,
fs::{Mode, OFlags, open},
fs::{open, Mode, OFlags},
};
let path = format!("/proc/{pid}/ns/mnt");
let fd = open(path, OFlags::RDONLY, Mode::from_raw_mode(0))?;