fn current_header(
        header_1: Result<Header>,
        header_2: Result<Header>,
    ) -> Result<(HeaderNo, Header)> {
        let mut header1_seq_num: u64 = 0;
        let mut header2_seq_num: u64 = 0;
        let mut valid_hdr_found: bool = false;

        if let Ok(ref header_1) = header_1 {
            valid_hdr_found = true;
            header1_seq_num = header_1.sequence_number;
        }

        if let Ok(ref header_2) = header_2 {
            valid_hdr_found = true;
            header2_seq_num = header_2.sequence_number;
        }

        if !valid_hdr_found {
            Err(VhdxHeaderError::NoValidHeader)
        } else if header1_seq_num >= header2_seq_num {
            Ok((HeaderNo::First, header_1.unwrap()))
        } else {
            Ok((HeaderNo::Second, header_2.unwrap()))
        }
    }
/// Identify the current header and return both headers along with an
/// integer indicating the current header.
Identify the current header and return both headers along with an
integer indicating the current header.
Identify the current header and return both headers along with an integer indicating the current header .
fn current_header(
        header_1: Result<Header>,
        header_2: Result<Header>,
    ) -> Result<(HeaderNo, Header)> {
        let mut header1_seq_num: u64 = 0;
        let mut header2_seq_num: u64 = 0;
        let mut valid_hdr_found: bool = false;
        if let Ok(ref header_1) = header_1 {
            valid_hdr_found = true;
            header1_seq_num = header_1.sequence_number;
        }
        if let Ok(ref header_2) = header_2 {
            valid_hdr_found = true;
            header2_seq_num = header_2.sequence_number;
        }
        if !valid_hdr_found {
            Err(VhdxHeaderError::NoValidHeader)
        } else if header1_seq_num >= header2_seq_num {
            Ok((HeaderNo::First, header_1.unwrap()))
        } else {
            Ok((HeaderNo::Second, header_2.unwrap()))
        }
    }
fn current_header ( header_1 : Result < Header > , header_2 : Result < Header > , ) -> Result < ( HeaderNo , Header ) > { let mut header1_seq_num : u64 = 0 ; let mut header2_seq_num : u64 = 0 ; let mut valid_hdr_found : bool = false ; if let Ok ( ref header_1 ) = header_1 { valid_hdr_found = true ; header1_seq_num = header_1 . sequence_number ; } if let Ok ( ref header_2 ) = header_2 { valid_hdr_found = true ; header2_seq_num = header_2 . sequence_number ; } if ! valid_hdr_found { Err ( VhdxHeaderError :: NoValidHeader ) } else if header1_seq_num >= header2_seq_num { Ok ( ( HeaderNo :: First , header_1 . unwrap ( ) ) ) } else { Ok ( ( HeaderNo :: Second , header_2 . unwrap ( ) ) ) } }
Identify the current header and return both headers along with an
integer indicating the current header.
Identify the current header and return both headers along with an integer indicating the current header .
header_1
Result<Header>
header_2
Result<Header>
header_1
Result<Header>
header_2
Result<Header>