// verify all state times are in agreement.
verify all state times are in agreement.
verify all state times are in agreement .
fn verify_time(info: ReachabilityInfo, want: ReachabilityInfo) -> (bool, String) {
            if info.info[&Proto::IPv4].state.time != want.info[&Proto::IPv4].state.time {
                return (
                    false,
                    format!(
                        "IPv4 time is incorrect {:?} != {:?}",
                        info.info[&Proto::IPv4].state,
                        want.info[&Proto::IPv4].state,
                    ),
                );
            };
            if info.info[&Proto::IPv4].previous_state.time
                != want.info[&Proto::IPv4].previous_state.time
            {
                return (
                    false,
                    format!(
                        "IPv4 previous time is incorrect {:?} != {:?}",
                        info.info[&Proto::IPv4].previous_state,
                        want.info[&Proto::IPv4].previous_state
                    ),
                );
            };
            if info.info[&Proto::IPv6].state.time != want.info[&Proto::IPv6].state.time {
                return (
                    false,
                    format!(
                        "IPv6 time is incorrect {:?} != {:?}",
                        info.info[&Proto::IPv6].state,
                        want.info[&Proto::IPv6].state
                    ),
                );
            };
            if info.info[&Proto::IPv6].previous_state.time
                != want.info[&Proto::IPv6].previous_state.time
            {
                return (
                    false,
                    format!(
                        "IPv6 previous time is incorrect {:?} != {:?}",
                        info.info[&Proto::IPv6].previous_state,
                        want.info[&Proto::IPv6].previous_state
                    ),
                );
            };
            (true, "ok".to_string())
        }
fn verify_time ( info : ReachabilityInfo , want : ReachabilityInfo ) -> ( bool , String ) { if info . info [ & Proto :: IPv4 ] . state . time != want . info [ & Proto :: IPv4 ] . state . time { return ( false , format ! ( " " info info [ Proto IPv4 ] state want info [ Proto IPv4 ] state ) , ) ; } ; if info . info [ & Proto :: IPv4 ] . previous_state . time != want . info [ & Proto :: IPv4 ] . previous_state . time { return ( false , format ! ( " " info info [ Proto IPv4 ] previous_state want info [ Proto IPv4 ] previous_state ) , ) ; } ; if info . info [ & Proto :: IPv6 ] . state . time != want . info [ & Proto :: IPv6 ] . state . time { return ( false , format ! ( " " info info [ Proto IPv6 ] state want info [ Proto IPv6 ] state ) , ) ; } ; if info . info [ & Proto :: IPv6 ] . previous_state . time != want . info [ & Proto :: IPv6 ] . previous_state . time { return ( false , format ! ( " " info info [ Proto IPv6 ] previous_state want info [ Proto IPv6 ] previous_state ) , ) ; } ; ( true , " " . to_string ( ) ) }
verify all state times are in agreement.
verify all state times are in agreement .
info
ReachabilityInfo
want
ReachabilityInfo