feat: add downloads directory argument for attachment download

Refs: #559
This commit is contained in:
Clément DOUIN
2026-01-21 22:12:30 +01:00
parent 63b3485575
commit 6219e30609
4 changed files with 34 additions and 23 deletions
+14
View File
@@ -6,5 +6,19 @@ pub mod email;
pub mod folder;
pub mod manual;
use std::path::PathBuf;
use shellexpand_utils::{canonicalize, expand};
#[doc(inline)]
pub use crate::email::{envelope, flag, message};
/// Parse the given [`str`] as [`PathBuf`].
///
/// The path is first shell expanded, then canonicalized (if
/// applicable).
fn dir_parser(path: &str) -> Result<PathBuf, String> {
expand::try_path(path)
.map(canonicalize::path)
.map_err(|err| err.to_string())
}