mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-29 04:04:45 +00:00
runtime-rs:fix cargo clippy
fix cargo clippy Fixes: #4791 Signed-off-by: Zhongtao Hu <zhongtaohu.tim@linux.alibaba.com>
This commit is contained in:
parent
9803393f2f
commit
7247575fa2
@ -739,18 +739,15 @@ pub fn umount_all<P: AsRef<Path>>(mountpoint: P, lazy_umount: bool) -> Result<()
|
||||
}
|
||||
|
||||
loop {
|
||||
match umount2(mountpoint.as_ref(), lazy_umount) {
|
||||
Err(e) => {
|
||||
// EINVAL is returned if the target is not a mount point, indicating that we are
|
||||
// done. It can also indicate a few other things (such as invalid flags) which we
|
||||
// unfortunately end up squelching here too.
|
||||
if e.kind() == io::ErrorKind::InvalidInput {
|
||||
break;
|
||||
} else {
|
||||
return Err(Error::Umount(mountpoint.as_ref().to_path_buf(), e));
|
||||
}
|
||||
if let Err(e) = umount2(mountpoint.as_ref(), lazy_umount) {
|
||||
// EINVAL is returned if the target is not a mount point, indicating that we are
|
||||
// done. It can also indicate a few other things (such as invalid flags) which we
|
||||
// unfortunately end up squelching here too.
|
||||
if e.kind() == io::ErrorKind::InvalidInput {
|
||||
break;
|
||||
} else {
|
||||
return Err(Error::Umount(mountpoint.as_ref().to_path_buf(), e));
|
||||
}
|
||||
Ok(()) => (),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -545,8 +545,8 @@ mod tests {
|
||||
let msg = format!("test[{}]", i);
|
||||
|
||||
// Create a writer for the logger drain to use
|
||||
let writer =
|
||||
NamedTempFile::new().unwrap_or_else(|_| panic!("{:}: failed to create tempfile", msg));
|
||||
let writer = NamedTempFile::new()
|
||||
.unwrap_or_else(|_| panic!("{:}: failed to create tempfile", msg));
|
||||
|
||||
// Used to check file contents before the temp file is unlinked
|
||||
let mut writer_ref = writer
|
||||
|
@ -35,7 +35,7 @@ pub(crate) fn set_logger(path: &str, sid: &str, is_debug: bool) -> Result<slog_a
|
||||
} else {
|
||||
log::Level::Info
|
||||
};
|
||||
let _ = slog_stdlog::init_with_level(level).context(format!("init with level {}", level))?;
|
||||
slog_stdlog::init_with_level(level).context(format!("init with level {}", level))?;
|
||||
|
||||
Ok(async_guard)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user