Skip to content

Commit

Permalink
Reintroduce lifetime in parse_content_and_signature
Browse files Browse the repository at this point in the history
Clippy is wrong here, the lifetime cannot be elided, else callers get an error
"one type is more general than the other".
  • Loading branch information
chifflier committed Sep 9, 2024
1 parent 4bb4e33 commit 824fd9f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tls_sign_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ pub fn parse_digitally_signed(i: &[u8]) -> IResult<&[u8], DigitallySigned> {

/// Parse DigitallySigned object, depending on the `ext` parameter which should
/// be true if the TLS client has sent the `signature_algorithms` extension
pub fn parse_content_and_signature<F, T>(
i: &[u8],
pub fn parse_content_and_signature<'a, F, T>(
i: &'a [u8],
fun: F,
ext: bool,
) -> IResult<&[u8], (T, DigitallySigned)>
) -> IResult<&'a [u8], (T, DigitallySigned<'a>)>
where
F: Fn(&[u8]) -> IResult<&[u8], T>,
F: Fn(&'a [u8]) -> IResult<&'a [u8], T>,
{
if ext {
pair(fun, parse_digitally_signed)(i)
Expand Down

0 comments on commit 824fd9f

Please sign in to comment.