ksud: fix clippy

This commit is contained in:
tiann
2023-03-27 15:44:18 +08:00
parent 284b962d64
commit b1af4ada60
2 changed files with 3 additions and 8 deletions

View File

@@ -101,7 +101,7 @@ pub fn get_zip_uncompressed_size(zip_path: &str) -> Result<u64> {
pub fn switch_mnt_ns(pid: i32) -> Result<()> {
use anyhow::ensure;
use std::os::fd::AsRawFd;
let path = format!("/proc/{}/ns/mnt", pid);
let path = format!("/proc/{pid}/ns/mnt");
let fd = std::fs::File::open(path)?;
let ret = unsafe { libc::setns(fd.as_raw_fd(), libc::CLONE_NEWNS) };
ensure!(ret == 0, "switch mnt ns failed");