Skip to content

Commit

Permalink
fix: fix some clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rex4539 committed Jan 27, 2025
1 parent 073e2af commit 0f7e5ff
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ mod private {
use super::*;
pub trait Sealed {}

impl<'buf> Sealed for AllPreallocated<'buf> {}
impl<'buf> Sealed for VerifyOnlyPreallocated<'buf> {}
impl<'buf> Sealed for SignOnlyPreallocated<'buf> {}
impl Sealed for AllPreallocated<'_> {}
impl Sealed for VerifyOnlyPreallocated<'_> {}
impl Sealed for SignOnlyPreallocated<'_> {}
}

#[cfg(feature = "alloc")]
Expand Down Expand Up @@ -274,13 +274,13 @@ mod alloc_only {
}
}

impl<'buf> Signing for SignOnlyPreallocated<'buf> {}
impl<'buf> Signing for AllPreallocated<'buf> {}
impl Signing for SignOnlyPreallocated<'_> {}
impl Signing for AllPreallocated<'_> {}

impl<'buf> Verification for VerifyOnlyPreallocated<'buf> {}
impl<'buf> Verification for AllPreallocated<'buf> {}
impl Verification for VerifyOnlyPreallocated<'_> {}
impl Verification for AllPreallocated<'_> {}

unsafe impl<'buf> Context for SignOnlyPreallocated<'buf> {
unsafe impl Context for SignOnlyPreallocated<'_> {
const FLAGS: c_uint = ffi::SECP256K1_START_SIGN;
const DESCRIPTION: &'static str = "signing only";

Expand All @@ -289,7 +289,7 @@ unsafe impl<'buf> Context for SignOnlyPreallocated<'buf> {
}
}

unsafe impl<'buf> Context for VerifyOnlyPreallocated<'buf> {
unsafe impl Context for VerifyOnlyPreallocated<'_> {
const FLAGS: c_uint = ffi::SECP256K1_START_VERIFY;
const DESCRIPTION: &'static str = "verification only";

Expand All @@ -298,7 +298,7 @@ unsafe impl<'buf> Context for VerifyOnlyPreallocated<'buf> {
}
}

unsafe impl<'buf> Context for AllPreallocated<'buf> {
unsafe impl Context for AllPreallocated<'_> {
const FLAGS: c_uint = SignOnlyPreallocated::FLAGS | VerifyOnlyPreallocated::FLAGS;
const DESCRIPTION: &'static str = "all capabilities";

Expand Down
2 changes: 1 addition & 1 deletion src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1517,7 +1517,7 @@ impl<'de> serde::Deserialize<'de> for Parity {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;

impl<'de> serde::de::Visitor<'de> for Visitor {
impl serde::de::Visitor<'_> for Visitor {
type Value = Parity;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ fn to_hex<'a>(src: &[u8], target: &'a mut [u8]) -> Result<&'a str, ()> {
}
let result = &target[..hex_len];
debug_assert!(str::from_utf8(result).is_ok());
return unsafe { Ok(str::from_utf8_unchecked(result)) };
unsafe { Ok(str::from_utf8_unchecked(result)) }
}

#[cfg(feature = "rand")]
Expand Down
4 changes: 2 additions & 2 deletions src/serde_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl<T> FromStrVisitor<T> {
}
}

impl<'de, T> de::Visitor<'de> for FromStrVisitor<T>
impl<T> de::Visitor<'_> for FromStrVisitor<T>
where
T: FromStr,
<T as FromStr>::Err: fmt::Display,
Expand Down Expand Up @@ -49,7 +49,7 @@ where
}
}

impl<'de, F, T, Err> de::Visitor<'de> for BytesVisitor<F>
impl<F, T, Err> de::Visitor<'_> for BytesVisitor<F>
where
F: FnOnce(&[u8]) -> Result<T, Err>,
Err: fmt::Display,
Expand Down

0 comments on commit 0f7e5ff

Please sign in to comment.