Skip to content
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

fixes for last couple months of CI changes #183

Merged
merged 6 commits into from
Jul 5, 2024
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
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() }
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, that is twice this week that code that I have worked on includes types that are not constructable. Seems this should be caught by the linter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a recent addition (only last couple weeks) to the rustc "dead code" lint. It's actually pretty clever because this is a publicly exported type -- there's just no publicly-exported function that returns it.

/// 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
Loading