diff --git a/src/primitives/checksum.rs b/src/primitives/checksum.rs index 7b3729e4..44091f04 100644 --- a/src/primitives/checksum.rs +++ b/src/primitives/checksum.rs @@ -227,7 +227,7 @@ impl<'a, ExtField> PrintImpl<'a, ExtField> { } } -impl<'a, ExtField> fmt::Display for PrintImpl<'a, ExtField> +impl fmt::Display for PrintImpl<'_, ExtField> where ExtField: super::Bech32Field + super::ExtensionField, { @@ -466,7 +466,7 @@ impl<'hrp> HrpFe32Iter<'hrp> { } } -impl<'hrp> Iterator for HrpFe32Iter<'hrp> { +impl Iterator for HrpFe32Iter<'_> { type Item = Fe32; #[inline] fn next(&mut self) -> Option { diff --git a/src/primitives/correction.rs b/src/primitives/correction.rs index e965f8ec..a6ce93b9 100644 --- a/src/primitives/correction.rs +++ b/src/primitives/correction.rs @@ -262,7 +262,7 @@ pub struct ErrorIterator<'c, Ck: Checksum> { c: usize, } -impl<'c, Ck: Checksum> Iterator for ErrorIterator<'c, Ck> { +impl Iterator for ErrorIterator<'_, Ck> { type Item = (usize, Fe32); fn next(&mut self) -> Option { diff --git a/src/primitives/decode.rs b/src/primitives/decode.rs index 213e6cdb..4f1d530a 100644 --- a/src/primitives/decode.rs +++ b/src/primitives/decode.rs @@ -709,7 +709,7 @@ pub struct ByteIter<'s> { iter: FesToBytes>, } -impl<'s> Iterator for ByteIter<'s> { +impl Iterator for ByteIter<'_> { type Item = u8; #[inline] fn next(&mut self) -> Option { self.iter.next() } @@ -717,7 +717,7 @@ impl<'s> Iterator for ByteIter<'s> { fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } } -impl<'s> ExactSizeIterator for ByteIter<'s> { +impl ExactSizeIterator for ByteIter<'_> { #[inline] fn len(&self) -> usize { self.iter.len() } } @@ -733,7 +733,7 @@ pub struct AsciiToFe32Iter<'s> { iter: iter::Copied>, } -impl<'s> Iterator for AsciiToFe32Iter<'s> { +impl Iterator for AsciiToFe32Iter<'_> { type Item = Fe32; #[inline] fn next(&mut self) -> Option { self.iter.next().map(Fe32::from_char_unchecked) } @@ -744,7 +744,7 @@ impl<'s> Iterator for AsciiToFe32Iter<'s> { } } -impl<'s> ExactSizeIterator for AsciiToFe32Iter<'s> { +impl ExactSizeIterator for AsciiToFe32Iter<'_> { #[inline] fn len(&self) -> usize { self.iter.len() } } diff --git a/src/primitives/encode.rs b/src/primitives/encode.rs index 65f2f852..883f914f 100644 --- a/src/primitives/encode.rs +++ b/src/primitives/encode.rs @@ -199,7 +199,7 @@ where } } -impl<'a, I, Ck> Iterator for CharIter<'a, I, Ck> +impl Iterator for CharIter<'_, I, Ck> where I: Iterator, Ck: Checksum, @@ -269,7 +269,7 @@ where pub fn new(char_iter: CharIter<'hrp, I, Ck>) -> Self { Self { char_iter } } } -impl<'a, I, Ck> Iterator for ByteIter<'a, I, Ck> +impl Iterator for ByteIter<'_, I, Ck> where I: Iterator, Ck: Checksum, @@ -311,7 +311,7 @@ where } } -impl<'hrp, I, Ck> Iterator for Fe32Iter<'hrp, I, Ck> +impl Iterator for Fe32Iter<'_, I, Ck> where I: Iterator, Ck: Checksum, diff --git a/src/primitives/hrp.rs b/src/primitives/hrp.rs index 5153bc20..a2a977ac 100644 --- a/src/primitives/hrp.rs +++ b/src/primitives/hrp.rs @@ -341,7 +341,7 @@ pub struct ByteIter<'b> { iter: slice::Iter<'b, u8>, } -impl<'b> Iterator for ByteIter<'b> { +impl Iterator for ByteIter<'_> { type Item = u8; #[inline] fn next(&mut self) -> Option { self.iter.next().copied() } @@ -349,17 +349,17 @@ impl<'b> Iterator for ByteIter<'b> { fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } } -impl<'b> ExactSizeIterator for ByteIter<'b> { +impl ExactSizeIterator for ByteIter<'_> { #[inline] fn len(&self) -> usize { self.iter.len() } } -impl<'b> DoubleEndedIterator for ByteIter<'b> { +impl DoubleEndedIterator for ByteIter<'_> { #[inline] fn next_back(&mut self) -> Option { self.iter.next_back().copied() } } -impl<'b> FusedIterator for ByteIter<'b> {} +impl FusedIterator for ByteIter<'_> {} /// Iterator over ASCII characters of the human-readable part. /// @@ -368,7 +368,7 @@ pub struct CharIter<'b> { iter: ByteIter<'b>, } -impl<'b> Iterator for CharIter<'b> { +impl Iterator for CharIter<'_> { type Item = char; #[inline] fn next(&mut self) -> Option { self.iter.next().map(Into::into) } @@ -376,24 +376,24 @@ impl<'b> Iterator for CharIter<'b> { fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } } -impl<'b> ExactSizeIterator for CharIter<'b> { +impl ExactSizeIterator for CharIter<'_> { #[inline] fn len(&self) -> usize { self.iter.len() } } -impl<'b> DoubleEndedIterator for CharIter<'b> { +impl DoubleEndedIterator for CharIter<'_> { #[inline] fn next_back(&mut self) -> Option { self.iter.next_back().map(Into::into) } } -impl<'b> FusedIterator for CharIter<'b> {} +impl FusedIterator for CharIter<'_> {} /// Iterator over lowercase bytes (ASCII characters) of the human-readable part. pub struct LowercaseByteIter<'b> { iter: ByteIter<'b>, } -impl<'b> Iterator for LowercaseByteIter<'b> { +impl Iterator for LowercaseByteIter<'_> { type Item = u8; #[inline] fn next(&mut self) -> Option { @@ -403,26 +403,26 @@ impl<'b> Iterator for LowercaseByteIter<'b> { fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } } -impl<'b> ExactSizeIterator for LowercaseByteIter<'b> { +impl ExactSizeIterator for LowercaseByteIter<'_> { #[inline] fn len(&self) -> usize { self.iter.len() } } -impl<'b> DoubleEndedIterator for LowercaseByteIter<'b> { +impl DoubleEndedIterator for LowercaseByteIter<'_> { #[inline] fn next_back(&mut self) -> Option { self.iter.next_back().map(|b| if is_ascii_uppercase(b) { b | 32 } else { b }) } } -impl<'b> FusedIterator for LowercaseByteIter<'b> {} +impl FusedIterator for LowercaseByteIter<'_> {} /// Iterator over lowercase ASCII characters of the human-readable part. pub struct LowercaseCharIter<'b> { iter: LowercaseByteIter<'b>, } -impl<'b> Iterator for LowercaseCharIter<'b> { +impl Iterator for LowercaseCharIter<'_> { type Item = char; #[inline] fn next(&mut self) -> Option { self.iter.next().map(Into::into) } @@ -430,17 +430,17 @@ impl<'b> Iterator for LowercaseCharIter<'b> { fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } } -impl<'b> ExactSizeIterator for LowercaseCharIter<'b> { +impl ExactSizeIterator for LowercaseCharIter<'_> { #[inline] fn len(&self) -> usize { self.iter.len() } } -impl<'b> DoubleEndedIterator for LowercaseCharIter<'b> { +impl DoubleEndedIterator for LowercaseCharIter<'_> { #[inline] fn next_back(&mut self) -> Option { self.iter.next_back().map(Into::into) } } -impl<'b> FusedIterator for LowercaseCharIter<'b> {} +impl FusedIterator for LowercaseCharIter<'_> {} fn is_ascii_uppercase(b: u8) -> bool { (65..=90).contains(&b) }