Skip to main content

tag_of

Function tag_of 

Source
pub fn tag_of(tag: &str) -> Option<Tag>
Expand description

The tag a line’s tag names, any case, or nothing for another.

use music21::romantext::tokens::{Tag, tag_of};

assert_eq!(tag_of("Time Signature"), Some(Tag::TimeSignature));
assert_eq!(tag_of("madrigal"), Some(Tag::Work));
assert_eq!(tag_of("Nothing"), None);