aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/init_command.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe/src/command/init_command.rs')
-rw-r--r--crates/shirabe/src/command/init_command.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/shirabe/src/command/init_command.rs b/crates/shirabe/src/command/init_command.rs
index f9a504be..81e1e381 100644
--- a/crates/shirabe/src/command/init_command.rs
+++ b/crates/shirabe/src/command/init_command.rs
@@ -94,7 +94,9 @@ impl InitCommand {
php_regex!(r#"/^(?P<name>[- .,\p{L}\p{N}\p{Mn}\'’\"()]+)(?:\s+<(?P<email>.+?)>)?$/u"#),
author,
) {
- let email = m.get(&CaptureKey::ByName("email".to_string())).cloned();
+ let email = m
+ .get(&CaptureKey::ByName("email".to_string()))
+ .map(str::to_string);
if let Some(ref email) = email
&& !self.is_valid_email(email)
{
@@ -107,8 +109,7 @@ impl InitCommand {
result.insert(
"name".to_string(),
Some(trim(
- &m.get(&CaptureKey::ByName("name".to_string()))
- .cloned()
+ m.get(&CaptureKey::ByName("name".to_string()))
.unwrap_or_default(),
None,
)),