chore: remove some uses of * (#569)
This commit is contained in:
@@ -177,20 +177,19 @@ impl MultiPartKind {
|
|||||||
fn to_mime<S: Into<String>>(&self, boundary: Option<S>) -> Mime {
|
fn to_mime<S: Into<String>>(&self, boundary: Option<S>) -> Mime {
|
||||||
let boundary = boundary.map_or_else(make_boundary, |s| s.into());
|
let boundary = boundary.map_or_else(make_boundary, |s| s.into());
|
||||||
|
|
||||||
use self::MultiPartKind::*;
|
|
||||||
format!(
|
format!(
|
||||||
"multipart/{}; boundary=\"{}\"{}",
|
"multipart/{}; boundary=\"{}\"{}",
|
||||||
match self {
|
match self {
|
||||||
Mixed => "mixed",
|
Self::Mixed => "mixed",
|
||||||
Alternative => "alternative",
|
Self::Alternative => "alternative",
|
||||||
Related => "related",
|
Self::Related => "related",
|
||||||
Encrypted { .. } => "encrypted",
|
Self::Encrypted { .. } => "encrypted",
|
||||||
Signed { .. } => "signed",
|
Self::Signed { .. } => "signed",
|
||||||
},
|
},
|
||||||
boundary,
|
boundary,
|
||||||
match self {
|
match self {
|
||||||
Encrypted { protocol } => format!("; protocol=\"{}\"", protocol),
|
Self::Encrypted { protocol } => format!("; protocol=\"{}\"", protocol),
|
||||||
Signed { protocol, micalg } =>
|
Self::Signed { protocol, micalg } =>
|
||||||
format!("; protocol=\"{}\"; micalg=\"{}\"", protocol, micalg),
|
format!("; protocol=\"{}\"; micalg=\"{}\"", protocol, micalg),
|
||||||
_ => String::new(),
|
_ => String::new(),
|
||||||
}
|
}
|
||||||
@@ -200,18 +199,17 @@ impl MultiPartKind {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn from_mime(m: &Mime) -> Option<Self> {
|
fn from_mime(m: &Mime) -> Option<Self> {
|
||||||
use self::MultiPartKind::*;
|
|
||||||
match m.subtype().as_ref() {
|
match m.subtype().as_ref() {
|
||||||
"mixed" => Some(Mixed),
|
"mixed" => Some(Self::Mixed),
|
||||||
"alternative" => Some(Alternative),
|
"alternative" => Some(Self::Alternative),
|
||||||
"related" => Some(Related),
|
"related" => Some(Self::Related),
|
||||||
"signed" => m.get_param("protocol").and_then(|p| {
|
"signed" => m.get_param("protocol").and_then(|p| {
|
||||||
m.get_param("micalg").map(|micalg| Signed {
|
m.get_param("micalg").map(|micalg| Self::Signed {
|
||||||
protocol: p.as_str().to_owned(),
|
protocol: p.as_str().to_owned(),
|
||||||
micalg: micalg.as_str().to_owned(),
|
micalg: micalg.as_str().to_owned(),
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
"encrypted" => m.get_param("protocol").map(|p| Encrypted {
|
"encrypted" => m.get_param("protocol").map(|p| Self::Encrypted {
|
||||||
protocol: p.as_str().to_owned(),
|
protocol: p.as_str().to_owned(),
|
||||||
}),
|
}),
|
||||||
_ => None,
|
_ => None,
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ use async_trait::async_trait;
|
|||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::{
|
use std::{
|
||||||
ffi::OsString,
|
ffi::OsString,
|
||||||
io::prelude::*,
|
io::Write,
|
||||||
process::{Command, Stdio},
|
process::{Command, Stdio},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user