pub fn should_expand(disk: &str) -> Result<bool> {
    let vtoc = prtvtoc(&disk)?;

    if vtoc.sector_size != 512 {
        bail!("only works with 512 byte sectors at the moment");
    }

    let reserved = vtoc.partitions.get("8").unwrap();
    if reserved.tag != "11" || reserved.sector_count != 16384 {
        bail!("slice 8 does not look like a regular reserved partition");
    }

    /*
     * We expect the reserved partition to be situated near the end of the
     * volume.  I'm not currently sure where the magic number comes from.
     */
    let expected_ls = vtoc.sector_count - 34;

    if expected_ls < reserved.sector_last {
        bail!("cannot shrink partition");
    }

    Ok(expected_ls > reserved.sector_last)
}
/**
 * Check to see if this disk requires expansion at the GPT table level using
 * format(1M).
 */
Check to see if this disk requires expansion at the GPT table level using
format(1M).
Check to see if this disk requires expansion at the GPT table level using format ( 1M ) .
pub fn should_expand(disk: &str) -> Result<bool> {
    let vtoc = prtvtoc(&disk)?;
    if vtoc.sector_size != 512 {
        bail!("only works with 512 byte sectors at the moment");
    }
    let reserved = vtoc.partitions.get("8").unwrap();
    if reserved.tag != "11" || reserved.sector_count != 16384 {
        bail!("slice 8 does not look like a regular reserved partition");
    }
    /*
     * We expect the reserved partition to be situated near the end of the
     * volume.  I'm not currently sure where the magic number comes from.
     */
    let expected_ls = vtoc.sector_count - 34;
    if expected_ls < reserved.sector_last {
        bail!("cannot shrink partition");
    }
    Ok(expected_ls > reserved.sector_last)
}
pub fn should_expand ( disk : & str ) -> Result < bool > { let vtoc = prtvtoc ( & disk ) ? ; if vtoc . sector_size != 512 { bail ! ( " " ) ; } let reserved = vtoc . partitions . get ( " " ) . unwrap ( ) ; if reserved . tag != " " || reserved . sector_count != 16384 { bail ! ( " " ) ; } /*
     * We expect the reserved partition to be situated near the end of the
     * volume.  I'm not currently sure where the magic number comes from.
     */ let expected_ls = vtoc . sector_count - 34 ; if expected_ls < reserved . sector_last { bail ! ( " " ) ; } Ok ( expected_ls > reserved . sector_last ) }
Check to see if this disk requires expansion at the GPT table level using
 format(1M).
Check to see if this disk requires expansion at the GPT table level using format ( 1M ) .
disk
&str
disk
&str