Skip to content

Commit 9f9e4b1

Browse files
committed
Merge #233: Fix latest clippy/rustc lints and release 0.11.1.
d477dec fix breaking compiler changes and release 0.11.1 (Andrew Poelstra) a355a1e update API files (Andrew Poelstra) 58de579 primitives: fix broken doc link (Andrew Poelstra) 2df03e7 fix new clippy and rustc warnings (Andrew Poelstra) Pull request description: The latest versions of rust-bitcoin and rust-elements depend on bech32 0.11.0. Unfortunately this has been hit by a recent breaking change in rustc rust-lang/rust#138907 Work around the break and cut a new version. While we're at it, fix all the recent lint changes (there are not many). ACKs for top commit: tcharding: ACK d477dec clarkmoody: ACK d477dec Tree-SHA512: b5a10d320c1e261bde0e7eb86f52c3c7f910ba7ba70c8fcd51f7127506f5f9db0d4f0f2084db62bf290277b49acdcc84a25a248583934d6d940fb5391a966a1e
2 parents c2aac49 + d477dec commit 9f9e4b1

File tree

8 files changed

+201
-69
lines changed

8 files changed

+201
-69
lines changed

Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bech32"
3-
version = "0.11.0"
3+
version = "0.11.1"
44
authors = ["Clark Moody", "Andrew Poelstra", "Tobin Harding"]
55
repository = "https://github.com/rust-bitcoin/rust-bech32"
66
documentation = "https://docs.rs/bech32/"
@@ -18,3 +18,7 @@ alloc = []
1818

1919
[target.'cfg(mutate)'.dev-dependencies]
2020
mutagen = { git = "https://github.com/llogiq/mutagen" }
21+
22+
[lints.rust]
23+
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(bench)', 'cfg(kani)', 'cfg(mutate)'] }
24+

api/all-features.txt

Lines changed: 63 additions & 19 deletions
Large diffs are not rendered by default.

api/alloc-only.txt

Lines changed: 62 additions & 19 deletions
Large diffs are not rendered by default.

api/no-features.txt

Lines changed: 59 additions & 19 deletions
Large diffs are not rendered by default.

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@
127127
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
128128
// Experimental features we need.
129129
#![cfg_attr(bench, feature(test))]
130-
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
131130
// Coding conventions
132131
#![deny(missing_docs)]
133132

src/primitives/decode.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const SEP: char = '1';
9292
/// checksum in any way.
9393
///
9494
/// Unless you are attempting to validate a string with multiple checksums then you likely do not
95-
/// want to use this type directly, instead use [`CheckedHrpstring::new(s)`].
95+
/// want to use this type directly, instead use [`CheckedHrpstring::new`]`(s)`.
9696
///
9797
/// # Examples
9898
///
@@ -134,7 +134,7 @@ impl<'s> UncheckedHrpstring<'s> {
134134

135135
let ret = UncheckedHrpstring {
136136
hrp: Hrp::parse(hrp)?,
137-
data_part_ascii: rest[1..].as_bytes(), // Skip the separator.
137+
data_part_ascii: &rest.as_bytes()[1..], // Skip the separator.
138138
hrpstring_length: s.len(),
139139
};
140140

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

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

@@ -661,7 +661,7 @@ impl<'s> SegwitHrpstring<'s> {
661661
///
662662
/// Use `self.witness_version()` to get the witness version.
663663
#[inline]
664-
pub fn byte_iter(&self) -> ByteIter {
664+
pub fn byte_iter(&self) -> ByteIter<'_> {
665665
ByteIter { iter: AsciiToFe32Iter { iter: self.ascii.iter().copied() }.fes_to_bytes() }
666666
}
667667
}

src/primitives/hrp.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,24 +163,24 @@ impl Hrp {
163163
/// If an uppercase HRP was parsed during object construction then this iterator will yield
164164
/// uppercase ASCII `char`s. For lowercase bytes see [`Self::lowercase_byte_iter`]
165165
#[inline]
166-
pub fn byte_iter(&self) -> ByteIter { ByteIter { iter: self.buf[..self.size].iter() } }
166+
pub fn byte_iter(&self) -> ByteIter<'_> { ByteIter { iter: self.buf[..self.size].iter() } }
167167

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

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

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

src/primitives/iter.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ pub trait Fe32IterExt: Sized + Iterator<Item = Fe32> {
6161

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

6769
impl<I> Fe32IterExt for I where I: Iterator<Item = Fe32> {}

0 commit comments

Comments
 (0)