/// Create a new name, checking whether it is valid. Returns ownership of the string if it
/// fails.
///
/// # Errors
///
/// Fails if the name is not a valid name.
Create a new name, checking whether it is valid. Returns ownership of the string if it
fails.
Create a new name checking whether it is valid . Returns ownership of the string if it fails .
pub fn new(name: String) -> Result<Self, String> {
        if Self::is_valid(&name) {
            Ok(Self(name))
        } else {
            Err(name)
        }
    }
pub fn new ( name : String ) -> Result < Self , String > { if Self :: is_valid ( & name ) { Ok ( Self ( name ) ) } else { Err ( name ) } }
Create a new name, checking whether it is valid.
Create a new name checking whether it is valid .
name
String
errors
Fails if the name is not a valid name.
Fails if the name is not a valid name .