Skip to content

Commit

Permalink
Merge pull request #42 from sunfishcode/sunfishcode/rustix-0.36
Browse files Browse the repository at this point in the history
cargo: update to rustix 0.36
  • Loading branch information
lucab authored Nov 8, 2022
2 parents 2b3928b + aa726df commit e62c9e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exclude = [".gitignore", ".travis.yml"]

[dependencies]
# Private dependencies.
rustix = { version = "0.35.6", features = ["fs"] }
rustix = { version = "0.36.0", features = ["fs"] }

[package.metadata.release]
disable-publish = true
Expand Down
6 changes: 2 additions & 4 deletions src/memfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ impl MemfdOptions {
let fd = rustix::fs::memfd_create(name.as_ref(), flags)
.map_err(Into::into)
.map_err(crate::Error::Create)?;
Ok(Memfd {
file: rustix::fd::FromFd::from_fd(fd.into()),
})
Ok(Memfd { file: fd.into() })
}
}

Expand Down Expand Up @@ -250,5 +248,5 @@ fn is_memfd<F: AsRawFd>(fd: &F) -> bool {
// is valid. Once `AsFd` is stabilized in std, we can use that instead of
// `AsRawFd`, and eliminate this `unsafe` block.
let fd = unsafe { rustix::fd::BorrowedFd::borrow_raw(fd.as_raw_fd()) };
rustix::fs::fcntl_get_seals(&fd).is_ok()
rustix::fs::fcntl_get_seals(fd).is_ok()
}

0 comments on commit e62c9e4

Please sign in to comment.