Function debian_control::parse_identity

source ·
pub fn parse_identity(s: &str) -> Result<(&str, &str), ParseIdentityError>
Expand description

Parse an identity string into a name and an email address.

The input string should be in the format Name <email>. If the email is missing, an error is returned.


use debian_control::parse_identity;
assert_eq!(parse_identity("Joe Example <>"), Ok(("Joe Example", "")));


  • s - The input string.


A tuple with the name and the email address.