Skip to content

Commit e759793

Browse files
committed
Clippy fixes
1 parent 9496bb1 commit e759793

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/common/base32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Base32Writer {
4040

4141
pub fn with_capacity(capacity: usize) -> Self {
4242
Base32Writer {
43-
result: String::with_capacity((capacity + 3) / 4 * 5),
43+
result: String::with_capacity(capacity.div_ceil(4) * 5),
4444
last_byte: 0,
4545
pos: 0,
4646
}

src/report/arf/generate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<'x> Feedback<'x> {
101101
) -> io::Result<String> {
102102
let mut buf = Vec::new();
103103
self.write_rfc5322(from, to, subject, &mut buf)?;
104-
String::from_utf8(buf).map_err(|err| io::Error::new(io::ErrorKind::Other, err))
104+
String::from_utf8(buf).map_err(io::Error::other)
105105
}
106106

107107
pub fn to_arf(&self) -> String {

src/report/dmarc/generate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl Report {
8585
) -> io::Result<String> {
8686
let mut buf = Vec::new();
8787
self.write_rfc5322(submitter, from, to, &mut buf)?;
88-
String::from_utf8(buf).map_err(|err| io::Error::new(io::ErrorKind::Other, err))
88+
String::from_utf8(buf).map_err(io::Error::other)
8989
}
9090

9191
pub fn to_xml(&self) -> String {

src/report/tlsrpt/generate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ impl TlsReport {
9898
) -> io::Result<String> {
9999
let mut buf = Vec::new();
100100
self.write_rfc5322(report_domain, submitter, from, to, &mut buf)?;
101-
String::from_utf8(buf).map_err(|err| io::Error::new(io::ErrorKind::Other, err))
101+
String::from_utf8(buf).map_err(io::Error::other)
102102
}
103103

104104
pub fn to_json(&self) -> String {

src/spf/verify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ impl MessageAuthenticator {
407407
}
408408

409409
// Evaluate explain
410-
if let (Some(macro_string), Some(SpfResult::Fail { .. })) = (&spf_record.exp, &result) {
410+
if let (Some(macro_string), Some(SpfResult::Fail)) = (&spf_record.exp, &result) {
411411
if let Ok(macro_string) = self
412412
.txt_lookup::<Macro>(
413413
macro_string.eval(&vars, &domain, true).to_string(),

0 commit comments

Comments
 (0)