pub fn remove_read(&mut self, item: &T) {
        if let Some(index) = self.find(item) {
            if index < self.shared {
                // move into shared
                self.items.swap(index, self.shared - 1);
                self.shared -= 1;

                // move into write
                self.items.swap(self.shared, self.write - 1);
                self.write -= 1;

                // remove
                self.items.swap_remove(self.write);
            } else if index < self.write {
                // move into write-only
                self.items.swap(index, self.write - 1);
                self.write -= 1;
            }
        }
    }
/// Removes read access to a resource from the permissions set.
Removes read access to a resource from the permissions set.
Removes read access to a resource from the permissions set .
pub fn remove_read(&mut self, item: &T) {
        if let Some(index) = self.find(item) {
            if index < self.shared {
                // move into shared
                self.items.swap(index, self.shared - 1);
                self.shared -= 1;
                // move into write
                self.items.swap(self.shared, self.write - 1);
                self.write -= 1;
                // remove
                self.items.swap_remove(self.write);
            } else if index < self.write {
                // move into write-only
                self.items.swap(index, self.write - 1);
                self.write -= 1;
            }
        }
    }
pub fn remove_read ( & mut self , item : & T ) { if let Some ( index ) = self . find ( item ) { if index < self . shared { // move into shared self . items . swap ( index , self . shared - 1 ) ; self . shared -= 1 ; // move into write self . items . swap ( self . shared , self . write - 1 ) ; self . write -= 1 ; // remove self . items . swap_remove ( self . write ) ; } else if index < self . write { // move into write-only self . items . swap ( index , self . write - 1 ) ; self . write -= 1 ; } } }
Removes read access to a resource from the permissions set.
Removes read access to a resource from the permissions set .
&mut self
item
&T
&mut self
item
&T