Skip to content

Commit e8f126e

Browse files
committed
no-std/alloc: fix a couple "unused import" warnings
1 parent e4c653a commit e8f126e

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/primitives/encode.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
//! }
4141
//! ```
4242
43-
use core::iter::Iterator;
4443
use core::marker::PhantomData;
4544

4645
use crate::primitives::checksum::HrpFe32Iter;

src/primitives/hrp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//!
1010
//! ref: [BIP-173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#user-content-Bech32)
1111
12-
#[cfg(feature = "alloc")]
12+
#[cfg(all(feature = "alloc", not(feature = "std"), not(test)))]
1313
use alloc::string::String;
1414
use core::cmp::Ordering;
1515
use core::fmt::{self, Write};

src/segwit.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,17 @@
4444
use alloc::{string::String, vec::Vec};
4545
use core::fmt;
4646

47+
#[cfg(feature = "alloc")]
4748
use crate::error::write_err;
4849
use crate::primitives::decode::SegwitCodeLengthError;
4950
#[cfg(feature = "alloc")]
5051
use crate::primitives::decode::{SegwitHrpstring, SegwitHrpstringError};
5152
use crate::primitives::gf32::Fe32;
5253
use crate::primitives::hrp::Hrp;
5354
use crate::primitives::iter::{ByteIterExt, Fe32IterExt};
55+
use crate::primitives::segwit::MAX_STRING_LENGTH;
5456
#[cfg(feature = "alloc")]
55-
use crate::primitives::segwit;
56-
use crate::primitives::segwit::{
57-
InvalidWitnessVersionError, WitnessLengthError, MAX_STRING_LENGTH,
58-
};
57+
use crate::primitives::segwit::{self, InvalidWitnessVersionError, WitnessLengthError};
5958
use crate::primitives::{Bech32, Bech32m};
6059

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

0 commit comments

Comments
 (0)