vhost_user_fs: sandbox: Fix clippy errors

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford 2020-10-19 16:25:06 +01:00 committed by Bo Chen
parent cf86ca15c2
commit 02621c6150

View File

@ -260,11 +260,8 @@ impl Sandbox {
// /proc/sys/fs/nr_open is a sysctl file that shows the maximum number
// of file-handles a process can allocate.
let path = "/proc/sys/fs/nr_open";
let max_str = fs::read_to_string(path).map_err(|e| Error::ReadProc(e))?;
let max = max_str
.trim()
.parse()
.map_err(|e| Error::InvalidNrOpen(e))?;
let max_str = fs::read_to_string(path).map_err(Error::ReadProc)?;
let max = max_str.trim().parse().map_err(Error::InvalidNrOpen)?;
let limit = libc::rlimit {
rlim_cur: max,