pub(crate) fn check_directory_supported(
    flat: FlatUnixFs<'_>,
) -> Result<FlatUnixFs<'_>, UnexpectedDirectoryProperties> {
    let data = flat.data.Data.as_deref();
    if flat.data.filesize.is_some()
        || !flat.data.blocksizes.is_empty()
        || flat.data.hashType.is_some()
        || flat.data.fanout.is_some()
        || !data.unwrap_or_default().is_empty()
    {
        let data = data.map(|s| s.to_vec());
        Err(UnexpectedDirectoryProperties {
            filesize: flat.data.filesize,
            blocksizes: flat.data.blocksizes,
            hash_type: flat.data.hashType,
            fanout: flat.data.fanout,
            data,
        })
    } else {
        Ok(flat)
    }
}
/// Ensures the directory looks like something we actually support.
Ensures the directory looks like something we actually support.
Ensures the directory looks like something we actually support .
pub(crate) fn check_directory_supported(
    flat: FlatUnixFs<'_>,
) -> Result<FlatUnixFs<'_>, UnexpectedDirectoryProperties> {
    let data = flat.data.Data.as_deref();
    if flat.data.filesize.is_some()
        || !flat.data.blocksizes.is_empty()
        || flat.data.hashType.is_some()
        || flat.data.fanout.is_some()
        || !data.unwrap_or_default().is_empty()
    {
        let data = data.map(|s| s.to_vec());
        Err(UnexpectedDirectoryProperties {
            filesize: flat.data.filesize,
            blocksizes: flat.data.blocksizes,
            hash_type: flat.data.hashType,
            fanout: flat.data.fanout,
            data,
        })
    } else {
        Ok(flat)
    }
}
pub ( crate ) fn check_directory_supported ( flat : FlatUnixFs < ' _ > , ) -> Result < FlatUnixFs < ' _ > , UnexpectedDirectoryProperties > { let data = flat . data . Data . as_deref ( ) ; if flat . data . filesize . is_some ( ) || ! flat . data . blocksizes . is_empty ( ) || flat . data . hashType . is_some ( ) || flat . data . fanout . is_some ( ) || ! data . unwrap_or_default ( ) . is_empty ( ) { let data = data . map ( | s | s . to_vec ( ) ) ; Err ( UnexpectedDirectoryProperties { filesize : flat . data . filesize , blocksizes : flat . data . blocksizes , hash_type : flat . data . hashType , fanout : flat . data . fanout , data , } ) } else { Ok ( flat ) } }
Ensures the directory looks like something we actually support.
Ensures the directory looks like something we actually support .
flat
FlatUnixFs<'_>