Commit
+2 -2 +/-1 browse
1 | diff --git a/src/dkim/headers.rs b/src/dkim/headers.rs |
2 | index aba5e91..83f1752 100644 |
3 | --- a/src/dkim/headers.rs |
4 | +++ b/src/dkim/headers.rs |
5 | @@ -15,7 +15,7 @@ use crate::common::headers::{HeaderWriter, Writer}; |
6 | use super::{Algorithm, Canonicalization, HashAlgorithm, Signature}; |
7 | |
8 | impl Signature { |
9 | - pub(crate) fn write(&self, writer: &mut impl Writer, as_header: bool) { |
10 | + pub fn write(&self, writer: &mut impl Writer, as_header: bool) { |
11 | let (header, new_line) = match self.ch { |
12 | Canonicalization::Relaxed if !as_header => (&b"dkim-signature:"[..], &b" "[..]), |
13 | _ => (&b"DKIM-Signature: "[..], &b"\r\n\t"[..]), |
14 | @@ -141,6 +141,6 @@ impl Display for Signature { |
15 | fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { |
16 | let mut buf = Vec::new(); |
17 | self.write(&mut buf, false); |
18 | - f.write_str(&String::from_utf8(buf).map_err(|_| std::fmt::Error)?) |
19 | + f.write_str(&String::from_utf8_lossy(&buf)) |
20 | } |
21 | } |