Skip to content

Commit

Permalink
Merge #132: Update nightly-version file
Browse files Browse the repository at this point in the history
0098582 Update nightly-version file (Tobin C. Harding)

Pull request description:

  The `nightly-version` file is 3 months old. We don't really have an update policy but it seems like 3 months is old enough.

  Grab the current version from `rust-bitcoin`.

ACKs for top commit:
  apoelstra:
    ACK 0098582; successfully ran local tests; thanks!

Tree-SHA512: 4c3840f78b6b4a7667b2f62e4ee67e9db3c0fb2149e0ff725ba0e092d5b40fb776abd225260cb2bb19d23525e06d9eed791424402802bbb28200a148804480ec
  • Loading branch information
apoelstra committed Dec 30, 2024
2 parents 8559f79 + 0098582 commit a23dad9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
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 @@ -250,25 +250,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 @@ -296,19 +296,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

0 comments on commit a23dad9

Please sign in to comment.