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

Update nightly-version file #132

Merged
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
8 changes: 4 additions & 4 deletions examples/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,21 @@ pub struct DisplayALittleBitHexy<'a> {
data: &'a [u8],
}

impl<'a> fmt::Display for DisplayALittleBitHexy<'a> {
impl fmt::Display for DisplayALittleBitHexy<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
}

impl<'a> fmt::Debug for DisplayALittleBitHexy<'a> {
impl fmt::Debug for DisplayALittleBitHexy<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
}

impl<'a> fmt::LowerHex for DisplayALittleBitHexy<'a> {
impl fmt::LowerHex for DisplayALittleBitHexy<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::LowerHex::fmt(&self.data.as_hex(), f)
}
}

impl<'a> fmt::UpperHex for DisplayALittleBitHexy<'a> {
impl fmt::UpperHex for DisplayALittleBitHexy<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::UpperHex::fmt(&self.data.as_hex(), f)
}
Expand Down
6 changes: 3 additions & 3 deletions fuzz/fuzz_targets/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ pub struct Hexy<'s> {
data: &'s [u8],
}

impl<'s> Hexy<'s> {
impl Hexy<'_> {
/// Demonstrates getting internal opaque data as a byte slice.
pub fn as_bytes(&self) -> &[u8] { self.data }
}

impl<'s> fmt::LowerHex for Hexy<'s> {
impl fmt::LowerHex for Hexy<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::LowerHex::fmt(&self.data.as_hex(), f)
}
}

impl<'s> fmt::UpperHex for Hexy<'s> {
impl fmt::UpperHex for Hexy<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fmt::UpperHex::fmt(&self.data.as_hex(), f)
}
Expand Down
2 changes: 1 addition & 1 deletion nightly-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2024-09-18
nightly-2024-12-26
18 changes: 9 additions & 9 deletions src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,25 +248,25 @@ pub struct DisplayByteSlice<'a> {
pub(crate) bytes: &'a [u8],
}

impl<'a> DisplayByteSlice<'a> {
impl DisplayByteSlice<'_> {
fn display(&self, f: &mut fmt::Formatter, case: Case) -> fmt::Result {
internal_display(self.bytes, f, case)
}
}

impl<'a> fmt::Display for DisplayByteSlice<'a> {
impl fmt::Display for DisplayByteSlice<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
}

impl<'a> fmt::Debug for DisplayByteSlice<'a> {
impl fmt::Debug for DisplayByteSlice<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
}

impl<'a> fmt::LowerHex for DisplayByteSlice<'a> {
impl fmt::LowerHex for DisplayByteSlice<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.display(f, Case::Lower) }
}

impl<'a> fmt::UpperHex for DisplayByteSlice<'a> {
impl fmt::UpperHex for DisplayByteSlice<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.display(f, Case::Upper) }
}

Expand Down Expand Up @@ -294,19 +294,19 @@ impl<'a, const CAP: usize> DisplayArray<'a, CAP> {
}
}

impl<'a, const LEN: usize> fmt::Display for DisplayArray<'a, LEN> {
impl<const LEN: usize> fmt::Display for DisplayArray<'_, LEN> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
}

impl<'a, const LEN: usize> fmt::Debug for DisplayArray<'a, LEN> {
impl<const LEN: usize> fmt::Debug for DisplayArray<'_, LEN> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { fmt::LowerHex::fmt(self, f) }
}

impl<'a, const LEN: usize> fmt::LowerHex for DisplayArray<'a, LEN> {
impl<const LEN: usize> fmt::LowerHex for DisplayArray<'_, LEN> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.display(f, Case::Lower) }
}

impl<'a, const LEN: usize> fmt::UpperHex for DisplayArray<'a, LEN> {
impl<const LEN: usize> fmt::UpperHex for DisplayArray<'_, LEN> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.display(f, Case::Upper) }
}

Expand Down
8 changes: 4 additions & 4 deletions src/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl<'a> HexDigitsIter<'a> {
fn new_unchecked(digits: &'a [u8]) -> Self { Self { iter: digits.chunks_exact(2) } }
}

impl<'a> Iterator for HexDigitsIter<'a> {
impl Iterator for HexDigitsIter<'_> {
type Item = [u8; 2];

#[inline]
Expand All @@ -210,7 +210,7 @@ impl<'a> Iterator for HexDigitsIter<'a> {
}
}

impl<'a> DoubleEndedIterator for HexDigitsIter<'a> {
impl DoubleEndedIterator for HexDigitsIter<'_> {
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
self.iter.next_back().map(|digits| digits.try_into().expect("HexDigitsIter invariant"))
Expand All @@ -222,9 +222,9 @@ impl<'a> DoubleEndedIterator for HexDigitsIter<'a> {
}
}

impl<'a> ExactSizeIterator for HexDigitsIter<'a> {}
impl ExactSizeIterator for HexDigitsIter<'_> {}

impl<'a> core::iter::FusedIterator for HexDigitsIter<'a> {}
impl core::iter::FusedIterator for HexDigitsIter<'_> {}

/// `hi` and `lo` are bytes representing hex characters.
///
Expand Down
8 changes: 4 additions & 4 deletions src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ where
/// Byte slice wrapper to serialize as a hex string in lowercase characters.
pub struct SerializeBytesAsHex<'a>(pub &'a [u8]);

impl<'a> serde::Serialize for SerializeBytesAsHex<'a> {
impl serde::Serialize for SerializeBytesAsHex<'_> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
Expand All @@ -86,7 +86,7 @@ impl<'a> serde::Serialize for SerializeBytesAsHex<'a> {
/// Byte slice wrapper to serialize as a hex string in lowercase characters.
pub struct SerializeBytesAsHexLower<'a>(pub &'a [u8]);

impl<'a> serde::Serialize for SerializeBytesAsHexLower<'a> {
impl serde::Serialize for SerializeBytesAsHexLower<'_> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
Expand All @@ -98,7 +98,7 @@ impl<'a> serde::Serialize for SerializeBytesAsHexLower<'a> {
/// Byte slice wrapper to serialize as a hex string in uppercase characters.
pub struct SerializeBytesAsHexUpper<'a>(pub &'a [u8]);

impl<'a> serde::Serialize for SerializeBytesAsHexUpper<'a> {
impl serde::Serialize for SerializeBytesAsHexUpper<'_> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
Expand All @@ -120,7 +120,7 @@ where
{
struct HexVisitor<T>(PhantomData<T>);

impl<'de, T> Visitor<'de> for HexVisitor<T>
impl<T> Visitor<'_> for HexVisitor<T>
where
T: FromHex,
{
Expand Down
Loading