pub fn check_invariants(&mut self) -> Result<(), BindingError<T>> {
        // The easiest way to do this is to use the existing code that checks for invariants when adding bindings.
        // So we'll just remove and then re-add all of the bindings.

        let action_bindings = self
            .actions
            .iter()
            .map(|(k, v)| (k.clone(), v.clone()))
            .collect::<Vec<_>>();
        for (k, v) in action_bindings {
            for c in v {
                self.remove_action_binding(&k, &c)
                    .expect("Unreachable: We just cloned the bindings, they can't be incorrect.");
                self.insert_action_binding(k.clone(), c)?;
            }
        }
        let axis_bindings = self
            .axes
            .iter()
            .map(|(k, v)| (k.clone(), v.clone()))
            .collect::<Vec<_>>();
        for (k, a) in axis_bindings {
            self.remove_axis(&k);
            self.insert_axis(k, a)?;
        }
        Ok(())
    }
/// Check that this structure upholds its guarantees. Should only be necessary when serializing or deserializing the bindings.
Check that this structure upholds its guarantees. Should only be necessary when serializing or deserializing the bindings.
Check that this structure upholds its guarantees . Should only be necessary when serializing or deserializing the bindings .
pub fn check_invariants(&mut self) -> Result<(), BindingError<T>> {
        // The easiest way to do this is to use the existing code that checks for invariants when adding bindings.
        // So we'll just remove and then re-add all of the bindings.
        let action_bindings = self
            .actions
            .iter()
            .map(|(k, v)| (k.clone(), v.clone()))
            .collect::<Vec<_>>();
        for (k, v) in action_bindings {
            for c in v {
                self.remove_action_binding(&k, &c)
                    .expect("Unreachable: We just cloned the bindings, they can't be incorrect.");
                self.insert_action_binding(k.clone(), c)?;
            }
        }
        let axis_bindings = self
            .axes
            .iter()
            .map(|(k, v)| (k.clone(), v.clone()))
            .collect::<Vec<_>>();
        for (k, a) in axis_bindings {
            self.remove_axis(&k);
            self.insert_axis(k, a)?;
        }
        Ok(())
    }
pub fn check_invariants ( & mut self ) -> Result < ( ) , BindingError < T > > { // The easiest way to do this is to use the existing code that checks for invariants when adding bindings. // So we'll just remove and then re-add all of the bindings. let action_bindings = self . actions . iter ( ) . map ( | ( k , v ) | ( k . clone ( ) , v . clone ( ) ) ) . collect :: < Vec < _ > > ( ) ; for ( k , v ) in action_bindings { for c in v { self . remove_action_binding ( & k , & c ) . expect ( " " ) ; self . insert_action_binding ( k . clone ( ) , c ) ? ; } } let axis_bindings = self . axes . iter ( ) . map ( | ( k , v ) | ( k . clone ( ) , v . clone ( ) ) ) . collect :: < Vec < _ > > ( ) ; for ( k , a ) in axis_bindings { self . remove_axis ( & k ) ; self . insert_axis ( k , a ) ? ; } Ok ( ( ) ) }
Check that this structure upholds its guarantees.
Check that this structure upholds its guarantees .
&mut self