pub fn parse(tag: [u8; 4], buf: &[u8]) -> Tag {
    // TODO: Key should be checked that it only contains ASCII characters.
    let key = String::from_utf8_lossy(&tag);
    let value = String::from_utf8_lossy(buf);

    // Attempt to assign a standardized tag key.
    let std_tag = match RIFF_INFO_MAP.get(key.to_lowercase().as_str()) {
        Some(&tag) => Some(tag),
        None => None,
    };

    Tag::new(std_tag, &key, Value::from(value))
}
/// Parse the RIFF INFO block into a `Tag` using the block's identifier tag and a slice
/// containing the block's contents.
Parse the RIFF INFO block into a `Tag` using the block's identifier tag and a slice
containing the block's contents.
Parse the RIFF INFO block into a ` Tag ` using the block ' s identifier tag and a slice containing the block ' s contents .
pub fn parse(tag: [u8; 4], buf: &[u8]) -> Tag {
    // TODO: Key should be checked that it only contains ASCII characters.
    let key = String::from_utf8_lossy(&tag);
    let value = String::from_utf8_lossy(buf);
    // Attempt to assign a standardized tag key.
    let std_tag = match RIFF_INFO_MAP.get(key.to_lowercase().as_str()) {
        Some(&tag) => Some(tag),
        None => None,
    };
    Tag::new(std_tag, &key, Value::from(value))
}
pub fn parse ( tag : [ u8 ; 4 ] , buf : & [ u8 ] ) -> Tag { // TODO: Key should be checked that it only contains ASCII characters. let key = String :: from_utf8_lossy ( & tag ) ; let value = String :: from_utf8_lossy ( buf ) ; // Attempt to assign a standardized tag key. let std_tag = match RIFF_INFO_MAP . get ( key . to_lowercase ( ) . as_str ( ) ) { Some ( & tag ) => Some ( tag ) , None => None , } ; Tag :: new ( std_tag , & key , Value :: from ( value ) ) }
Parse the RIFF INFO block into a `Tag` using the block's identifier tag and a slice
containing the block's contents.
Parse the RIFF INFO block into a ` Tag ` using the block ' s identifier tag and a slice containing the block ' s contents .
tag
[u8; 4]
buf
&[u8]
tag
[u8; 4]
buf
&[u8]