pub fn new(name: &str) -> Result<NoteName, NoteError> {
        match name.to_lowercase().as_str() {
            "a" => Ok(NoteName::A),
            "b" => Ok(NoteName::B),
            "c" => Ok(NoteName::C),
            "d" => Ok(NoteName::D),
            "e" => Ok(NoteName::E),
            "f" => Ok(NoteName::F),
            "g" => Ok(NoteName::G),
            _ => Err(NoteError::InvalidNoteName)
        }
    }
/// Instantiate from a string representing the note name; case-insensitive.
Instantiate from a string representing the note name; case-insensitive.
Instantiate from a string representing the note name ; case - insensitive .
pub fn new(name: &str) -> Result<NoteName, NoteError> {
        match name.to_lowercase().as_str() {
            "a" => Ok(NoteName::A),
            "b" => Ok(NoteName::B),
            "c" => Ok(NoteName::C),
            "d" => Ok(NoteName::D),
            "e" => Ok(NoteName::E),
            "f" => Ok(NoteName::F),
            "g" => Ok(NoteName::G),
            _ => Err(NoteError::InvalidNoteName)
        }
    }
pub fn new ( name : & str ) -> Result < NoteName , NoteError > { match name . to_lowercase ( ) . as_str ( ) { " " => Ok ( NoteName :: A ) , " " => Ok ( NoteName :: B ) , " " => Ok ( NoteName :: C ) , " " => Ok ( NoteName :: D ) , " " => Ok ( NoteName :: E ) , " " => Ok ( NoteName :: F ) , " " => Ok ( NoteName :: G ) , _ => Err ( NoteError :: InvalidNoteName ) } }
Instantiate from a string representing the note name; case-insensitive.
Instantiate from a string representing the note name ; case - insensitive .
name
&str