refactor vim fn naming

This commit is contained in:
Clément DOUIN
2021-04-04 14:25:55 +02:00
parent 9f7173a572
commit 3d702677b5
16 changed files with 155 additions and 561 deletions
+5 -9
View File
@@ -302,37 +302,33 @@ pub fn msg_matches(matches: &ArgMatches) -> Result<()> {
}
if let Some(matches) = matches.subcommand_matches("template") {
let mut imap_conn = ImapConnector::new(&account)?;
if let Some(_) = matches.subcommand_matches("new") {
let tpl = Msg::build_new_tpl(&config, &account)?;
print(&output_fmt, &tpl)?;
}
if let Some(matches) = matches.subcommand_matches("reply") {
let mut imap_conn = ImapConnector::new(&account)?;
let uid = matches.value_of("uid").unwrap();
let mbox = matches.value_of("mailbox").unwrap();
let msg = Msg::from(imap_conn.read_msg(&mbox, &uid)?);
let tpl = if matches.is_present("reply-all") {
msg.build_reply_all_tpl(&config, &account)?
} else {
msg.build_reply_tpl(&config, &account)?
};
print(&output_fmt, &tpl)?;
imap_conn.logout();
}
if let Some(matches) = matches.subcommand_matches("forward") {
let mut imap_conn = ImapConnector::new(&account)?;
let uid = matches.value_of("uid").unwrap();
let mbox = matches.value_of("mailbox").unwrap();
let msg = Msg::from(imap_conn.read_msg(&mbox, &uid)?);
let tpl = msg.build_forward_tpl(&config, &account)?;
print(&output_fmt, &tpl)?;
break;
imap_conn.logout();
}
imap_conn.logout();
break;
}