pub fn patch_if_needed<T: PartialEq + Clone>( old_state: &mut Option<T>, patch: &mut Option<T>, new_value: T, ) -> bool