Skip to content
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
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bech32"
version = "0.11.0"
version = "0.11.1"
authors = ["Clark Moody", "Andrew Poelstra", "Tobin Harding"]
repository = "https://github.com/rust-bitcoin/rust-bech32"
documentation = "https://docs.rs/bech32/"
Expand All @@ -18,3 +18,7 @@ alloc = []

[target.'cfg(mutate)'.dev-dependencies]
mutagen = { git = "https://github.com/llogiq/mutagen" }

[lints.rust]
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(bench)', 'cfg(kani)', 'cfg(mutate)'] }

82 changes: 63 additions & 19 deletions api/all-features.txt

Large diffs are not rendered by default.

81 changes: 62 additions & 19 deletions api/alloc-only.txt

Large diffs are not rendered by default.

78 changes: 59 additions & 19 deletions api/no-features.txt

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
// Experimental features we need.
#![cfg_attr(bench, feature(test))]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
// Coding conventions
#![deny(missing_docs)]

Expand Down
10 changes: 5 additions & 5 deletions src/primitives/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const SEP: char = '1';
/// checksum in any way.
///
/// Unless you are attempting to validate a string with multiple checksums then you likely do not
/// want to use this type directly, instead use [`CheckedHrpstring::new(s)`].
/// want to use this type directly, instead use [`CheckedHrpstring::new`]`(s)`.
///
/// # Examples
///
Expand Down Expand Up @@ -134,7 +134,7 @@ impl<'s> UncheckedHrpstring<'s> {

let ret = UncheckedHrpstring {
hrp: Hrp::parse(hrp)?,
data_part_ascii: rest[1..].as_bytes(), // Skip the separator.
data_part_ascii: &rest.as_bytes()[1..], // Skip the separator.
hrpstring_length: s.len(),
};

Expand Down Expand Up @@ -442,7 +442,7 @@ impl<'s> CheckedHrpstring<'s> {
///
/// Converts the ASCII bytes representing field elements to the respective field elements.
#[inline]
pub fn fe32_iter<I: Iterator<Item = u8>>(&self) -> AsciiToFe32Iter {
pub fn fe32_iter<I: Iterator<Item = u8>>(&self) -> AsciiToFe32Iter<'_> {
AsciiToFe32Iter { iter: self.ascii.iter().copied() }
}

Expand All @@ -451,7 +451,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 @@ -661,7 +661,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
8 changes: 4 additions & 4 deletions src/primitives/hrp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,24 +163,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 @@ -61,7 +61,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
Loading