// HACK
// This differs from `is_projection_dirty` only in that the callback
// returns owned data instead of borrowed. One might think that this
// method could therefore be used to implement the other; but it can't,
// because the lifetime in F's return type would be overconstrained.
HACK
This differs from `is_projection_dirty` only in that the callback
returns owned data instead of borrowed. One might think that this
method could therefore be used to implement the other; but it can't,
because the lifetime in F's return type would be overconstrained.
HACK This differs from ` is_projection_dirty ` only in that the callback returns owned data instead of borrowed . One might think that this method could therefore be used to implement the other ; but it can ' t because the lifetime in F ' s return type would be overconstrained .
pub fn is_function_dirty<K: PartialEq>(
        &self,
        mut f: impl FnMut(&T) -> K,
    ) -> bool {
        match (&self.clean, &self.dirty) {
            (Some(clean), Some(dirty)) => f(clean) != f(dirty),
            (None, Some(_)) => true,
            (Some(_), None) => false,
            (None, None) => unreachable!(),
        }
    }
pub fn is_function_dirty < K : PartialEq > ( & self , mut f : impl FnMut ( & T ) -> K , ) -> bool { match ( & self . clean , & self . dirty ) { ( Some ( clean ) , Some ( dirty ) ) => f ( clean ) != f ( dirty ) , ( None , Some ( _ ) ) => true , ( Some ( _ ) , None ) => false , ( None , None ) => unreachable ! ( ) , } }
HACK
This differs from `is_projection_dirty` only in that the callback
returns owned data instead of borrowed.
HACK This differs from ` is_projection_dirty ` only in that the callback returns owned data instead of borrowed .
&self
f
impl FnMut(&T) -> K