fn try_extend(state: &mut SPState, other_state: SPState) -> Option<SPState> {
    let can_extend = other_state.projection().state.iter().all(|(p, v)| {
        let self_v = state.sp_value_from_path(p);
        p.leaf() == "timestamp" || self_v.map(|x| x == v.value()).unwrap_or(true)
    });
    if can_extend {
        state.extend(other_state);
        None
    } else {
        Some(other_state)
    }
}
/// Tries to extend the state only if the state does not contain the same
/// path or if that path has the same value, else will leave the state unchanged
/// and returns false.
Tries to extend the state only if the state does not contain the same
path or if that path has the same value, else will leave the state unchanged
and returns false.
Tries to extend the state only if the state does not contain the same path or if that path has the same value else will leave the state unchanged and returns false .
fn try_extend(state: &mut SPState, other_state: SPState) -> Option<SPState> {
    let can_extend = other_state.projection().state.iter().all(|(p, v)| {
        let self_v = state.sp_value_from_path(p);
        p.leaf() == "timestamp" || self_v.map(|x| x == v.value()).unwrap_or(true)
    });
    if can_extend {
        state.extend(other_state);
        None
    } else {
        Some(other_state)
    }
}
fn try_extend ( state : & mut SPState , other_state : SPState ) -> Option < SPState > { let can_extend = other_state . projection ( ) . state . iter ( ) . all ( | ( p , v ) | { let self_v = state . sp_value_from_path ( p ) ; p . leaf ( ) == " " || self_v . map ( | x | x == v . value ( ) ) . unwrap_or ( true ) } ) ; if can_extend { state . extend ( other_state ) ; None } else { Some ( other_state ) } }
Tries to extend the state only if the state does not contain the same
path or if that path has the same value, else will leave the state unchanged
and returns false.
Tries to extend the state only if the state does not contain the same path or if that path has the same value else will leave the state unchanged and returns false .
state
&mut SPState
other_state
SPState