Fix various clippy lints

This commit is contained in:
Jack Grigg 2021-09-12 19:53:20 +01:00
parent 8cf431cd48
commit 36ca0c236e
2 changed files with 8 additions and 14 deletions

View file

@ -141,11 +141,11 @@ pub mod read {
fn is_base64_char(c: u8) -> bool {
// Check against the ASCII values of the standard Base64 character set.
match c {
matches!(
c,
// A..=Z | a..=z | 0..=9 | + | /
65..=90 | 97..=122 | 48..=57 | 43 | 47 => true,
_ => false,
}
65..=90 | 97..=122 | 48..=57 | 43 | 47,
)
}
/// From the age specification:
@ -201,7 +201,7 @@ pub mod read {
/// recipient stanza is a body of canonical base64 from RFC 4648 without padding
/// wrapped at exactly 64 columns.
/// ```
pub fn age_stanza<'a>(input: &'a [u8]) -> IResult<&'a [u8], AgeStanza<'a>> {
pub fn age_stanza(input: &[u8]) -> IResult<&[u8], AgeStanza<'_>> {
map(
pair(
preceded(
@ -217,7 +217,7 @@ pub mod read {
)(input)
}
fn legacy_age_stanza_inner<'a>(input: &'a [u8]) -> IResult<&'a [u8], AgeStanza<'a>> {
fn legacy_age_stanza_inner(input: &[u8]) -> IResult<&[u8], AgeStanza<'_>> {
map(
pair(
preceded(tag(STANZA_TAG), separated_list1(tag(" "), arbitrary_string)),
@ -254,7 +254,7 @@ pub mod read {
/// age files encrypted with beta versions of the `age` or `rage` crates.
///
/// [`grease_the_joint`]: super::grease_the_joint
pub fn legacy_age_stanza<'a>(input: &'a [u8]) -> IResult<&'a [u8], AgeStanza<'a>> {
pub fn legacy_age_stanza(input: &[u8]) -> IResult<&[u8], AgeStanza<'_>> {
alt((age_stanza, legacy_age_stanza_inner))(input)
}