Make clippy happy
- Applied many of the `clippy` suggestions.
This commit is contained in:
@@ -59,7 +59,7 @@ impl<'hc> HuskContext<'hc> {
|
||||
|
||||
pub async fn add_recipient(&mut self, rcpt: String) {
|
||||
|
||||
let certs = crypto::get_certificates(&self, rcpt.as_str()).await;
|
||||
let certs = crypto::get_certificates(self, rcpt.as_str()).await;
|
||||
|
||||
self.mail.add_recipient(rcpt, certs)
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ impl Display for Introducer {
|
||||
.map(|u| String::from_utf8_lossy(u.userid().value()).to_string())
|
||||
.collect::<Vec<String>>()
|
||||
.join(", ");
|
||||
write!(f, "Introducer: {}\n", self.cert.fingerprint())?;
|
||||
writeln!(f, "Introducer: {}", self.cert.fingerprint())?;
|
||||
write!(f, " UserIDs: {}", uids)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -66,6 +66,13 @@ impl<'mc> MailContext<'mc> {
|
||||
|
||||
}
|
||||
|
||||
/// Default Mailcontext
|
||||
impl<'mc> Default for MailContext<'mc> {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&MailContext<'_>> for ProtectionPossibility {
|
||||
fn from(mail_context: &MailContext<'_>) -> ProtectionPossibility {
|
||||
let mut can_encrypt = false;
|
||||
|
||||
@@ -17,8 +17,8 @@ pub struct Recipient<'r> {
|
||||
|
||||
impl From<String> for Recipient<'_> {
|
||||
fn from(email: String) -> Self {
|
||||
Recipient {
|
||||
email: email,
|
||||
Recipient {
|
||||
email,
|
||||
certs: Vec::new()
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ impl Recipient<'_> {
|
||||
/// check if this Recipient can encrypt.
|
||||
// XXX: currently this check is naive
|
||||
pub fn can_encrypt(&self) -> bool {
|
||||
if self.certs.len() == 0 {
|
||||
if self.certs.is_empty() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user