Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix some clippy warnings #776

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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<'_> {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honesty, these feel like useless churn but whatever, I don't care.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clippy requires we change them.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, I'd consider turning off that lint. Or maybe, if it was off by default, I wouldn't turn it on.

}

#[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
Loading