|
|
|
@ -16,6 +16,7 @@ pub enum FormatType {
|
|
|
|
|
AppleMail,
|
|
|
|
|
GmailVault,
|
|
|
|
|
Mbox,
|
|
|
|
|
#[cfg(not(target_os = "windows"))]
|
|
|
|
|
Maildir,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -29,6 +30,7 @@ impl FormatType {
|
|
|
|
|
FormatType::AppleMail => "Apple Mail",
|
|
|
|
|
FormatType::GmailVault => "Gmail Vault Download",
|
|
|
|
|
FormatType::Mbox => "Mbox",
|
|
|
|
|
#[cfg(not(target_os = "windows"))]
|
|
|
|
|
FormatType::Maildir => "Maildir",
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -41,6 +43,9 @@ impl Default for FormatType {
|
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
|
return FormatType::AppleMail;
|
|
|
|
|
|
|
|
|
|
#[cfg(target_os = "windows")]
|
|
|
|
|
return FormatType::Mbox;
|
|
|
|
|
|
|
|
|
|
#[cfg(not(target_os = "macos"))]
|
|
|
|
|
return FormatType::Maildir;
|
|
|
|
|
}
|
|
|
|
@ -58,6 +63,7 @@ impl From<&str> for FormatType {
|
|
|
|
|
"apple" => FormatType::AppleMail,
|
|
|
|
|
"gmailvault" => FormatType::GmailVault,
|
|
|
|
|
"mbox" => FormatType::Mbox,
|
|
|
|
|
#[cfg(not(target_os = "windows"))]
|
|
|
|
|
"maildir" => FormatType::Maildir,
|
|
|
|
|
_ => panic!("Unknown format: {}", &format),
|
|
|
|
|
}
|
|
|
|
@ -70,6 +76,7 @@ impl From<FormatType> for String {
|
|
|
|
|
FormatType::AppleMail => "apple".to_owned(),
|
|
|
|
|
FormatType::GmailVault => "gmailvault".to_owned(),
|
|
|
|
|
FormatType::Mbox => "mbox".to_owned(),
|
|
|
|
|
#[cfg(not(target_os = "windows"))]
|
|
|
|
|
FormatType::Maildir => "maildir".to_owned(),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|