pub fn remove_state(&mut self, state: impl Into<String>) -> Option<String> {
        let state: String = state.into();

        if !state.is_empty() && self.states.contains(&state) {
            while let Some(pos) = self.states.iter().position(|x| *x == state) {
                self.states.remove(pos);
            }

            self.dirty = true;
            return Some(state);
        }

        None
    }
/// Removes all instances of the give state from the vector and returns it.
Removes all instances of the give state from the vector and returns it.
Removes all instances of the give state from the vector and returns it .
pub fn remove_state(&mut self, state: impl Into<String>) -> Option<String> {
        let state: String = state.into();
        if !state.is_empty() && self.states.contains(&state) {
            while let Some(pos) = self.states.iter().position(|x| *x == state) {
                self.states.remove(pos);
            }
            self.dirty = true;
            return Some(state);
        }
        None
    }
pub fn remove_state ( & mut self , state : impl Into < String > ) -> Option < String > { let state : String = state . into ( ) ; if ! state . is_empty ( ) && self . states . contains ( & state ) { while let Some ( pos ) = self . states . iter ( ) . position ( | x | * x == state ) { self . states . remove ( pos ) ; } self . dirty = true ; return Some ( state ) ; } None }
Removes all instances of the give state from the vector and returns it.
Removes all instances of the give state from the vector and returns it .
&mut self
state
impl Into<String>