MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / parse_author

Method parse_author

atomic-cli/src/commands/revise.rs:445–458  ·  view source on GitHub ↗

Parse author string into name and email.

(&self)

Source from the content-addressed store, hash-verified

443
444 /// Parse author string into name and email.
445 pub(crate) fn parse_author(&self) -> Option<(String, Option<String>)> {
446 self.author.as_ref().map(|author_str| {
447 // Try to parse "Name <email>" format
448 if let Some(start) = author_str.find('<') {
449 if let Some(end) = author_str.find('>') {
450 let name = author_str[..start].trim().to_string();
451 let email = author_str[start + 1..end].trim().to_string();
452 return (name, Some(email));
453 }
454 }
455 // Just a name
456 (author_str.trim().to_string(), None)
457 })
458 }
459
460 /// Display what would be done in dry-run mode.
461 fn display_dry_run(

Callers 7

recordFunction · 0.45
reviseFunction · 0.45
execute_reviseMethod · 0.45
runMethod · 0.45
test_parse_author_fullFunction · 0.45

Calls 1

as_refMethod · 0.80

Tested by 3

test_parse_author_fullFunction · 0.36