wasi-common: wiggle flags are now bitflags!

this mostly mechanical change is just getting rid of passing to
`contains` by reference.
This commit is contained in:
Pat Hickey
2021-01-11 18:27:43 -08:00
parent ed44a19e5e
commit 75a9dc7fe2
8 changed files with 62 additions and 62 deletions

View File

@@ -78,7 +78,7 @@ impl Entry {
/// `HandleRights` structure is a subset of rights attached to this `Entry`. The check is
/// performed using `Entry::validate_rights` method. If the check fails, `Error::Notcapable`
/// is returned.
pub(crate) fn as_handle(&self, rights: &HandleRights) -> Result<EntryHandle> {
pub(crate) fn as_handle(&self, rights: HandleRights) -> Result<EntryHandle> {
self.validate_rights(rights)?;
Ok(self.handle.get())
}
@@ -87,7 +87,7 @@ impl Entry {
/// rights attached to this `Entry` object are a superset.
///
/// Upon unsuccessful check, `Error::Notcapable` is returned.
pub(crate) fn validate_rights(&self, rights: &HandleRights) -> Result<()> {
pub(crate) fn validate_rights(&self, rights: HandleRights) -> Result<()> {
let this_rights = self.handle.get_rights();
if this_rights.contains(rights) {
Ok(())