review copy command

This commit is contained in:
Clément DOUIN
2021-09-19 11:18:17 +02:00
parent c155d30e54
commit 2e27972716
4 changed files with 8 additions and 6 deletions
+1
View File
@@ -44,4 +44,5 @@ pub fn target_arg<'a>() -> Arg<'a, 'a> {
Arg::with_name("target")
.help("Specifies the targetted mailbox")
.value_name("TARGET")
.required(true)
}
+3 -1
View File
@@ -152,7 +152,9 @@ impl TryFrom<Option<&str>> for Mbox {
fn try_from(mbox: Option<&str>) -> Result<Self, Self::Error> {
debug!("init mailbox from `{:?}`", mbox);
Ok(Self {
name: mbox.ok_or(anyhow!("cannot parse mailbox"))?.to_string(),
name: mbox
.ok_or(anyhow!("the target mailbox cannot be empty"))?
.to_string(),
..Self::default()
})
}