Skip to content

Commit

Permalink
Fix unused field lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Feb 25, 2022
1 parent 40302a8 commit 3d83d55
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/vfs/src/host_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ pub struct File {
#[cfg_attr(feature = "enable-serde", serde(skip_serializing))]
pub inner: fs::File,
pub host_path: PathBuf,
#[cfg(feature = "enable-serde")]
flags: u16,
}

Expand Down Expand Up @@ -303,24 +304,25 @@ impl File {

/// creates a new host file from a `std::fs::File` and a path
pub fn new(file: fs::File, host_path: PathBuf, read: bool, write: bool, append: bool) -> Self {
let mut flags = 0;
let mut _flags = 0;

if read {
flags |= Self::READ;
_flags |= Self::READ;
}

if write {
flags |= Self::WRITE;
_flags |= Self::WRITE;
}

if append {
flags |= Self::APPEND;
_flags |= Self::APPEND;
}

Self {
inner: file,
host_path,
flags,
#[cfg(feature = "enable-serde")]
_flags,
}
}

Expand Down

0 comments on commit 3d83d55

Please sign in to comment.