Skip to content

Commit 5e907bc

Browse files
committed
Merge rust-bitcoin#5070: Fix clippy lint with no-default-features in primitives and units
0408f3d Fix unused clippy lint (Jamil Lambert, PhD) 67eea0b Fix explicit lifetime clippy lint (Jamil Lambert, PhD) 1363dc6 Fix unused import clippy lint (Jamil Lambert, PhD) Pull request description: There are a few lint errors in `units` and `primitives` with `no-default-features`. Fix the lint errors in `units` and `primitives` with `no-default-features`. ACKs for top commit: apoelstra: ACK 0408f3d; successfully ran local tests tcharding: ACK 0408f3d Tree-SHA512: d2b2ae03bcf021dd8f62e88850c61f0e41f09497778278bb8f16c82567aa9f1f3a9df14b4a7157c75eac9b2fb70602f8a1a12dbc9f311029b54bdc8f7c085a30
2 parents c96523c + 0408f3d commit 5e907bc

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

consensus_encoding/src/encode/encoders.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<'e, T: Encodable> SliceEncoder<'e, T> {
101101
}
102102
}
103103

104-
impl<'e, T: Encodable> Encoder for SliceEncoder<'e, T> {
104+
impl<T: Encodable> Encoder for SliceEncoder<'_, T> {
105105
fn current_chunk(&self) -> Option<&[u8]> {
106106
if let Some(compact_size) = self.compact_size.as_ref() {
107107
return Some(compact_size);

primitives/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ pub mod _export {
4141
}
4242

4343
mod hash_types;
44+
#[cfg(feature = "alloc")]
4445
mod opcodes;
4546

4647
pub mod block;

units/src/amount/tests.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ use core::num::{NonZeroI64, NonZeroU64};
1111
use std::panic;
1212

1313
use super::*;
14-
use crate::result::{MathOp, NumOpResult};
14+
use crate::result::NumOpResult;
15+
#[cfg(feature = "alloc")]
16+
use crate::result::MathOp;
1517
#[cfg(feature = "alloc")]
1618
use crate::{FeeRate, Weight};
1719

0 commit comments

Comments
 (0)