fn parse(tag: &str) -> Tag {
    // Vorbis Comments (aka tags) are stored as <key>=<value> where <key> is
    // a reduced ASCII-only identifier and <value> is a UTF8 value.
    //
    // <Key> must only contain ASCII 0x20 through 0x7D, with 0x3D ('=') excluded.
    // ASCII 0x41 through 0x5A inclusive (A-Z) is to be considered equivalent to
    // ASCII 0x61 through 0x7A inclusive (a-z) for tag matching.

    let field: Vec<&str> = tag.splitn(2, '=').collect();

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

    // The value field was empty so only the key field exists. Create an empty tag for the given
    // key field.
    if field.len() == 1 {
        return Tag::new(std_tag, field[0], Value::from(""));
    }

    Tag::new(std_tag, field[0], Value::from(field[1]))
}
/// Parse the given Vorbis Comment string into a `Tag`.
Parse the given Vorbis Comment string into a `Tag`.
Parse the given Vorbis Comment string into a ` Tag ` .
fn parse(tag: &str) -> Tag {
    // Vorbis Comments (aka tags) are stored as <key>=<value> where <key> is
    // a reduced ASCII-only identifier and <value> is a UTF8 value.
    //
    // <Key> must only contain ASCII 0x20 through 0x7D, with 0x3D ('=') excluded.
    // ASCII 0x41 through 0x5A inclusive (A-Z) is to be considered equivalent to
    // ASCII 0x61 through 0x7A inclusive (a-z) for tag matching.
    let field: Vec<&str> = tag.splitn(2, '=').collect();
    // Attempt to assign a standardized tag key.
    let std_tag = match VORBIS_COMMENT_MAP.get(field[0].to_lowercase().as_str()) {
        Some(&tag) => Some(tag),
        None => None,
    };
    // The value field was empty so only the key field exists. Create an empty tag for the given
    // key field.
    if field.len() == 1 {
        return Tag::new(std_tag, field[0], Value::from(""));
    }
    Tag::new(std_tag, field[0], Value::from(field[1]))
}
fn parse ( tag : & str ) -> Tag { // Vorbis Comments (aka tags) are stored as <key>=<value> where <key> is // a reduced ASCII-only identifier and <value> is a UTF8 value. // // <Key> must only contain ASCII 0x20 through 0x7D, with 0x3D ('=') excluded. // ASCII 0x41 through 0x5A inclusive (A-Z) is to be considered equivalent to // ASCII 0x61 through 0x7A inclusive (a-z) for tag matching. let field : Vec < & str > = tag . splitn ( 2 , '=' ) . collect ( ) ; // Attempt to assign a standardized tag key. let std_tag = match VORBIS_COMMENT_MAP . get ( field [ 0 ] . to_lowercase ( ) . as_str ( ) ) { Some ( & tag ) => Some ( tag ) , None => None , } ; // The value field was empty so only the key field exists. Create an empty tag for the given // key field. if field . len ( ) == 1 { return Tag :: new ( std_tag , field [ 0 ] , Value :: from ( " " ) ) ; } Tag :: new ( std_tag , field [ 0 ] , Value :: from ( field [ 1 ] ) ) }
Parse the given Vorbis Comment string into a `Tag`.
Parse the given Vorbis Comment string into a ` Tag ` .
tag
&str
tag
&str