Parse author string into name and email.
(&self)
| 430 | |
| 431 | /// Parse author string into name and email. |
| 432 | fn parse_author(&self) -> Option<(String, Option<String>)> { |
| 433 | self.author.as_ref().map(|author_str| { |
| 434 | // Try to parse "Name <email>" format |
| 435 | if let Some(start) = author_str.find('<') { |
| 436 | if let Some(end) = author_str.find('>') { |
| 437 | let name = author_str[..start].trim().to_string(); |
| 438 | let email = author_str[start + 1..end].trim().to_string(); |
| 439 | return (name, Some(email)); |
| 440 | } |
| 441 | } |
| 442 | // Just a name |
| 443 | (author_str.trim().to_string(), None) |
| 444 | }) |
| 445 | } |
| 446 | |
| 447 | /// Display what would be done in dry-run mode. |
| 448 | fn display_dry_run( |