diff options
Diffstat (limited to 'src/cmd.rs')
-rw-r--r-- | src/cmd.rs | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -26,6 +26,7 @@ pub enum Return { Count(CountInfo), Search(Vec<Mail>), Move, + Remove, } pub fn serialize_to<W>(res: Result<Return>, mut write: W) -> std::io::Result<()> @@ -56,6 +57,7 @@ where Ok(r) } Return::Move => ser.serialize_unit(), + Return::Remove => ser.serialize_unit(), }?; Ok(()) } @@ -85,6 +87,12 @@ pub fn move_mail(p: PathBuf, mid: &str, from_f: &str, to_f: &str) -> Result<()> from.move_to(mid, &to).map_err(|e| e.into()) } +pub fn remove_mail(p: PathBuf, sub: &str, mid: &str) -> Result<()> { + let md = open_submaildir(p, sub); + dbg!(mid); + md.add_flags(mid, "T").map_err(|e| e.into()) +} + pub fn search(_md: &Maildir, _pattern: &str) -> Result<Vec<Mail>> { todo!() } |