fn check_consistency(
        primary: &GPTHeader,
        secondary: &GPTHeader,
    ) -> Result<(), LabelError> {
        if primary.guid != secondary.guid {
            return Err(LabelError::CompareDiskGUID {});
        }
        if primary.lba_start != secondary.lba_start
            || primary.lba_end != secondary.lba_end
        {
            return Err(LabelError::CompareDiskSize {});
        }
        if primary.lba_alt != secondary.lba_self
            || secondary.lba_alt != primary.lba_self
        {
            return Err(LabelError::BackupLocation {});
        }
        if primary.table_crc != secondary.table_crc {
            return Err(LabelError::ComparePartitionTableChecksum {});
        }
        Ok(())
    }
/// check that primary and secondary GPTHeaders
/// are consistent with each other
check that primary and secondary GPTHeaders
are consistent with each other
check that primary and secondary GPTHeaders are consistent with each other
fn check_consistency(
        primary: &GPTHeader,
        secondary: &GPTHeader,
    ) -> Result<(), LabelError> {
        if primary.guid != secondary.guid {
            return Err(LabelError::CompareDiskGUID {});
        }
        if primary.lba_start != secondary.lba_start
            || primary.lba_end != secondary.lba_end
        {
            return Err(LabelError::CompareDiskSize {});
        }
        if primary.lba_alt != secondary.lba_self
            || secondary.lba_alt != primary.lba_self
        {
            return Err(LabelError::BackupLocation {});
        }
        if primary.table_crc != secondary.table_crc {
            return Err(LabelError::ComparePartitionTableChecksum {});
        }
        Ok(())
    }
fn check_consistency ( primary : & GPTHeader , secondary : & GPTHeader , ) -> Result < ( ) , LabelError > { if primary . guid != secondary . guid { return Err ( LabelError :: CompareDiskGUID { } ) ; } if primary . lba_start != secondary . lba_start || primary . lba_end != secondary . lba_end { return Err ( LabelError :: CompareDiskSize { } ) ; } if primary . lba_alt != secondary . lba_self || secondary . lba_alt != primary . lba_self { return Err ( LabelError :: BackupLocation { } ) ; } if primary . table_crc != secondary . table_crc { return Err ( LabelError :: ComparePartitionTableChecksum { } ) ; } Ok ( ( ) ) }
check that primary and secondary GPTHeaders
are consistent with each other
check that primary and secondary GPTHeaders are consistent with each other
primary
&GPTHeader
secondary
&GPTHeader