diff --git a/src/cmd/import.rs b/src/cmd/import.rs index 1c2b474c..8e70006d 100644 --- a/src/cmd/import.rs +++ b/src/cmd/import.rs @@ -746,7 +746,7 @@ impl Headers { let (name, email) = value .to_str() .map_err(|_| anyhow!("From/Author is not UTF-8")) - .and_then(|s| signature::parse_name_email(s).map_err(|e| e)) + .and_then(signature::parse_name_email) .context("parsing From/Author header")?; headers.author_name = Some(name.to_string()); headers.author_email = Some(email.to_string()); diff --git a/src/patchrange.rs b/src/patchrange.rs index 28304379..ffee250e 100644 --- a/src/patchrange.rs +++ b/src/patchrange.rs @@ -2,7 +2,7 @@ //! Parse user-provided patch ranges. -use std::str::FromStr; +use std::{fmt::Write, str::FromStr}; use crate::{patchname::PatchName, stack::StackStateAccess}; @@ -440,9 +440,9 @@ fn similar_patchnames(patchname: &PatchName, allowed_patchnames: &[&PatchName]) } else { let mut similar_str = String::new(); for pn in similar[..similar.len() - 1].iter() { - similar_str.push_str(&format!("`{pn}`, ")); + write!(&mut similar_str, "`{pn}`, ").unwrap(); } - similar_str.push_str(&format!("and `{}`", similar[similar.len() - 1])); + write!(&mut similar_str, "and `{}`", similar[similar.len() - 1]).unwrap(); Some(similar_str) } }