pub fn check_prev_header(header: &Header) -> SysValidationResult<()> {
    match &header {
        Header::Saf(_) => Ok(()),
        _ => {
            if header.header_seq() > 0 {
                header
                    .prev_header()
                    .ok_or(PrevHeaderError::MissingPrev)
                    .map_err(ValidationOutcome::from)?;
                Ok(())
            } else {
                Err(PrevHeaderError::InvalidRoot).map_err(|e| ValidationOutcome::from(e).into())
            }
        }
    }
}
/// Check that previous header makes sense
/// for this header.
/// If not Saf then cannot be root of chain
/// and must have previous header
Check that previous header makes sense
for this header.
If not Saf then cannot be root of chain
and must have previous header
Check that previous header makes sense for this header . If not Saf then cannot be root of chain and must have previous header
pub fn check_prev_header(header: &Header) -> SysValidationResult<()> {
    match &header {
        Header::Saf(_) => Ok(()),
        _ => {
            if header.header_seq() > 0 {
                header
                    .prev_header()
                    .ok_or(PrevHeaderError::MissingPrev)
                    .map_err(ValidationOutcome::from)?;
                Ok(())
            } else {
                Err(PrevHeaderError::InvalidRoot).map_err(|e| ValidationOutcome::from(e).into())
            }
        }
    }
}
pub fn check_prev_header ( header : & Header ) -> SysValidationResult < ( ) > { match & header { Header :: Saf ( _ ) => Ok ( ( ) ) , _ => { if header . header_seq ( ) > 0 { header . prev_header ( ) . ok_or ( PrevHeaderError :: MissingPrev ) . map_err ( ValidationOutcome :: from ) ? ; Ok ( ( ) ) } else { Err ( PrevHeaderError :: InvalidRoot ) . map_err ( | e | ValidationOutcome :: from ( e ) . into ( ) ) } } } }
Check that previous header makes sense
for this header.
Check that previous header makes sense for this header .
header
&Header
header
&Header