Skip to content

Commit

Permalink
Merge #183: fixes for last couple months of CI changes
Browse files Browse the repository at this point in the history
ca3f2ef update and run cargo-public-api again for recent changes (Andrew Poelstra)
e8f126e no-std/alloc: fix a couple "unused import" warnings (Andrew Poelstra)
e4c653a docs: fix a couple unescaped `[` instances which `cargo doc` complains on (Andrew Poelstra)
9ff8288 primitives: remove unused and unconstructable Fe32Iter struct (Andrew Poelstra)
88da498 cargo: whitelist `cfg` flags for latest versions of cargo (Andrew Poelstra)
18bfc5f api: add `Freeze` marker to API files (change in cargo-public-api) (Andrew Poelstra)

Pull request description:

  Clippy, public-api and cargo.

ACKs for top commit:
  clarkmoody:
    ACK ca3f2ef

Tree-SHA512: dfef5071ceaa1303bedffb46cd7a9095533559b58244271ab3428b50afcfd6debb2127ad5164be3e8c13325c3890d75682e9aaf3ed86afdbafb127560a821a18
  • Loading branch information
apoelstra committed Jul 5, 2024
2 parents cd20221 + ca3f2ef commit 8529aff
Show file tree
Hide file tree
Showing 9 changed files with 180 additions and 98 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ 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)' ] }
85 changes: 59 additions & 26 deletions api/all-features.txt

Large diffs are not rendered by default.

84 changes: 58 additions & 26 deletions api/alloc-only.txt

Large diffs are not rendered by default.

81 changes: 55 additions & 26 deletions api/no-features.txt

Large diffs are not rendered by default.

13 changes: 0 additions & 13 deletions src/primitives/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,19 +720,6 @@ impl<'s> ExactSizeIterator for ByteIter<'s> {
fn len(&self) -> usize { self.iter.len() }
}

/// An iterator over a parsed HRP string data as field elements.
pub struct Fe32Iter<'s> {
iter: AsciiToFe32Iter<'s>,
}

impl<'s> Iterator for Fe32Iter<'s> {
type Item = Fe32;
#[inline]
fn next(&mut self) -> Option<Fe32> { self.iter.next() }
#[inline]
fn size_hint(&self) -> (usize, Option<usize>) { self.iter.size_hint() }
}

/// Iterator adaptor that maps an iterator of valid bech32 character ASCII bytes to an
/// iterator of field elements.
///
Expand Down
1 change: 0 additions & 1 deletion src/primitives/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
//! }
//! ```

use core::iter::Iterator;
use core::marker::PhantomData;

use crate::primitives::checksum::HrpFe32Iter;
Expand Down
2 changes: 1 addition & 1 deletion src/primitives/gf32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const CHARS_LOWER: [char; 32] = [

/// Mapping from bech32 character (either case) to numeric value.
///
/// E.g., 'z' is CHARS_LOWER[2] and is ASCII value 122 so CHARS_INV[122] == 2
/// E.g., 'z' is `CHARS_LOWER[2]` and is ASCII value 122 so `CHARS_INV[122]` == 2
#[rustfmt::skip]
const CHARS_INV: [i8; 128] = [
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Expand Down
2 changes: 1 addition & 1 deletion src/primitives/hrp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//!
//! ref: [BIP-173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#user-content-Bech32)

#[cfg(feature = "alloc")]
#[cfg(all(feature = "alloc", not(feature = "std"), not(test)))]
use alloc::string::String;
use core::cmp::Ordering;
use core::fmt::{self, Write};
Expand Down
7 changes: 3 additions & 4 deletions src/segwit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,17 @@
use alloc::{string::String, vec::Vec};
use core::fmt;

#[cfg(feature = "alloc")]
use crate::error::write_err;
use crate::primitives::decode::SegwitCodeLengthError;
#[cfg(feature = "alloc")]
use crate::primitives::decode::{SegwitHrpstring, SegwitHrpstringError};
use crate::primitives::gf32::Fe32;
use crate::primitives::hrp::Hrp;
use crate::primitives::iter::{ByteIterExt, Fe32IterExt};
use crate::primitives::segwit::MAX_STRING_LENGTH;
#[cfg(feature = "alloc")]
use crate::primitives::segwit;
use crate::primitives::segwit::{
InvalidWitnessVersionError, WitnessLengthError, MAX_STRING_LENGTH,
};
use crate::primitives::segwit::{self, InvalidWitnessVersionError, WitnessLengthError};
use crate::primitives::{Bech32, Bech32m};

#[rustfmt::skip] // Keep public re-exports separate.
Expand Down

0 comments on commit 8529aff

Please sign in to comment.