Skip to content

Commit

Permalink
Repair some clippy lints
Browse files Browse the repository at this point in the history
These seem to be new with the Rust 1.62.0 toolchain.
  • Loading branch information
jpgrayson committed Jul 6, 2022
1 parent 48258d2 commit e2b518d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cmd/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
6 changes: 3 additions & 3 deletions src/patchrange.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit e2b518d

Please sign in to comment.