Skip to main content

parse_author

Function parse_author 

Source
pub fn parse_author(input: &str) -> Author
Expand description

Parse an author string into its Author parts.

Returns an empty Author for input with no word characters, or input that does not match the expected Name <email> (url) shape (e.g. an unterminated bracket).

assert_eq!(parse_author::parse_author("").name, None);
assert_eq!(parse_author::parse_author("Foo (https://x.dev)").url.as_deref(), Some("https://x.dev"));