pub fn from_offset<'a>(
        hash: &'a FileHash<'input>,
        offset: TypeOffset,
    ) -> Option<Cow<'a, Type<'input>>> {
        if offset.is_none() {
            return Some(Cow::Borrowed(&hash.void));
        }
        hash.types
            .get(&offset)
            .map(|ty| Cow::Borrowed(*ty))
            .or_else(|| hash.file.get_type(offset).map(Cow::Owned))
    }
/// Lookup a type given its offset.
///
/// Returns `None` if the type offset is invalid.
Lookup a type given its offset.
Returns `None` if the type offset is invalid.
Lookup a type given its offset . Returns ` None ` if the type offset is invalid .
pub fn from_offset<'a>(
        hash: &'a FileHash<'input>,
        offset: TypeOffset,
    ) -> Option<Cow<'a, Type<'input>>> {
        if offset.is_none() {
            return Some(Cow::Borrowed(&hash.void));
        }
        hash.types
            .get(&offset)
            .map(|ty| Cow::Borrowed(*ty))
            .or_else(|| hash.file.get_type(offset).map(Cow::Owned))
    }
pub fn from_offset < ' a > ( hash : & ' a FileHash < ' input > , offset : TypeOffset , ) -> Option < Cow < ' a , Type < ' input > > > { if offset . is_none ( ) { return Some ( Cow :: Borrowed ( & hash . void ) ) ; } hash . types . get ( & offset ) . map ( | ty | Cow :: Borrowed ( * ty ) ) . or_else ( | | hash . file . get_type ( offset ) . map ( Cow :: Owned ) ) }
Lookup a type given its offset.
Lookup a type given its offset .
hash
&'a FileHash<'input>
offset
TypeOffset
hash
&'a FileHash<'input>
offset
TypeOffset