Skip to content

Run the linter #219

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion src/primitives/correction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl<Ck: Checksum> Corrector<Ck> {
///
/// If the input string has sufficiently many errors, this unique closest correct
/// string may not actually be the intended string.
pub fn bch_errors(&self) -> Option<ErrorIterator<Ck>> {
pub fn bch_errors(&self) -> Option<ErrorIterator<'_, Ck>> {
// 1. Compute all syndromes by evaluating the residue at each power of the generator.
let syndromes: Polynomial<_> = Ck::ROOT_GENERATOR
.powers_range(Ck::ROOT_EXPONENTS)
Expand Down
6 changes: 3 additions & 3 deletions src/primitives/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ impl<'s> CheckedHrpstring<'s> {
///
/// Converts the ASCII bytes representing field elements to the respective field elements.
#[inline]
pub fn fe32_iter(&self, _: u8) -> AsciiToFe32Iter {
pub fn fe32_iter(&self, _: u8) -> AsciiToFe32Iter<'_> {
AsciiToFe32Iter { iter: self.ascii.iter().copied() }
}

Expand All @@ -453,7 +453,7 @@ impl<'s> CheckedHrpstring<'s> {
/// Converts the ASCII bytes representing field elements to the respective field elements, then
/// converts the stream of field elements to a stream of bytes.
#[inline]
pub fn byte_iter(&self) -> ByteIter {
pub fn byte_iter(&self) -> ByteIter<'_> {
ByteIter { iter: AsciiToFe32Iter { iter: self.ascii.iter().copied() }.fes_to_bytes() }
}

Expand Down Expand Up @@ -663,7 +663,7 @@ impl<'s> SegwitHrpstring<'s> {
///
/// Use `self.witness_version()` to get the witness version.
#[inline]
pub fn byte_iter(&self) -> ByteIter {
pub fn byte_iter(&self) -> ByteIter<'_> {
ByteIter { iter: AsciiToFe32Iter { iter: self.ascii.iter().copied() }.fes_to_bytes() }
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/primitives/fieldvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl<F> FieldVec<F> {
/// # Panics
///
/// Panics if [`Self::has_data`] is false.
pub fn iter(&self) -> slice::Iter<F> {
pub fn iter(&self) -> slice::Iter<'_, F> {
if self.len > NO_ALLOC_MAX_LENGTH {
self.assert_has_data();
#[cfg(feature = "alloc")]
Expand All @@ -143,7 +143,7 @@ impl<F> FieldVec<F> {
/// # Panics
///
/// Panics if [`Self::has_data`] is false.
pub fn iter_mut(&mut self) -> slice::IterMut<F> {
pub fn iter_mut(&mut self) -> slice::IterMut<'_, F> {
if self.len > NO_ALLOC_MAX_LENGTH {
self.assert_has_data();
#[cfg(feature = "alloc")]
Expand Down
8 changes: 4 additions & 4 deletions src/primitives/hrp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,24 +237,24 @@ impl Hrp {
/// If an uppercase HRP was parsed during object construction then this iterator will yield
/// uppercase ASCII `char`s. For lowercase bytes see [`Self::lowercase_byte_iter`]
#[inline]
pub fn byte_iter(&self) -> ByteIter { ByteIter { iter: self.buf[..self.size].iter() } }
pub fn byte_iter(&self) -> ByteIter<'_> { ByteIter { iter: self.buf[..self.size].iter() } }

/// Creates a character iterator over the ASCII characters of this HRP.
///
/// If an uppercase HRP was parsed during object construction then this iterator will yield
/// uppercase ASCII `char`s. For lowercase bytes see [`Self::lowercase_char_iter`].
#[inline]
pub fn char_iter(&self) -> CharIter { CharIter { iter: self.byte_iter() } }
pub fn char_iter(&self) -> CharIter<'_> { CharIter { iter: self.byte_iter() } }

/// Creates a lowercase iterator over the byte values (ASCII characters) of this HRP.
#[inline]
pub fn lowercase_byte_iter(&self) -> LowercaseByteIter {
pub fn lowercase_byte_iter(&self) -> LowercaseByteIter<'_> {
LowercaseByteIter { iter: self.byte_iter() }
}

/// Creates a lowercase character iterator over the ASCII characters of this HRP.
#[inline]
pub fn lowercase_char_iter(&self) -> LowercaseCharIter {
pub fn lowercase_char_iter(&self) -> LowercaseCharIter<'_> {
LowercaseCharIter { iter: self.lowercase_byte_iter() }
}

Expand Down
4 changes: 3 additions & 1 deletion src/primitives/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ pub trait Fe32IterExt: Sized + Iterator<Item = Fe32> {

/// Adapts the Fe32 iterator to encode the field elements into a bech32 address.
#[inline]
fn with_checksum<Ck: Checksum>(self, hrp: &Hrp) -> Encoder<Self, Ck> { Encoder::new(self, hrp) }
fn with_checksum<Ck: Checksum>(self, hrp: &Hrp) -> Encoder<'_, Self, Ck> {
Encoder::new(self, hrp)
}
}

impl<I> Fe32IterExt for I where I: Iterator<Item = Fe32> {}
Expand Down
2 changes: 1 addition & 1 deletion src/primitives/polynomial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl<F: Field> Polynomial<F> {
/// # Panics
///
/// Panics if [`Self::has_data`] is false.
pub fn iter(&self) -> slice::Iter<F> {
pub fn iter(&self) -> slice::Iter<'_, F> {
self.assert_has_data();
self.coefficients().iter()
}
Expand Down
Loading