Skip to content

Commit

Permalink
Style: use impl Trait instead of explicitly-named type parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
briansmith committed Feb 18, 2021
1 parent ba54ede commit ead26ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/der.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ pub fn read_tag_and_get_value<'a>(

// TODO: investigate taking decoder as a reference to reduce generated code
// size.
pub fn nested_of_mut<'a, F, E: Copy>(
pub fn nested_of_mut<'a, E>(
input: &mut untrusted::Reader<'a>,
outer_tag: Tag,
inner_tag: Tag,
error: E,
mut decoder: F,
mut decoder: impl FnMut(&mut untrusted::Reader<'a>) -> Result<(), E>,
) -> Result<(), E>
where
F: FnMut(&mut untrusted::Reader<'a>) -> Result<(), E>,
E: Copy,
{
nested(input, outer_tag, error, |outer| {
loop {
Expand Down
6 changes: 4 additions & 2 deletions src/verify_cert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,12 @@ fn check_eku(
}
}

fn loop_while_non_fatal_error<V, F>(values: V, f: F) -> Result<(), Error>
fn loop_while_non_fatal_error<V>(
values: V,
f: impl Fn(V::Item) -> Result<(), Error>,
) -> Result<(), Error>
where
V: IntoIterator,
F: Fn(V::Item) -> Result<(), Error>,
{
for v in values {
match f(v) {
Expand Down

0 comments on commit ead26ed

Please sign in to comment.