Skip to content

Commit 99ef43c

Browse files
authored
Merge pull request #5633 from jbencin/chore/remove-unused-imports-stacks-common
chore(stacks-common): Remove unused imports and enable warning
2 parents c0a9c38 + c84ae7c commit 99ef43c

File tree

22 files changed

+29
-61
lines changed

22 files changed

+29
-61
lines changed

stacks-common/src/address/b58.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
//! Base58 encoder and decoder
1616
17-
use std::{error, fmt, str};
17+
use std::{fmt, str};
1818

1919
use crate::address::Error;
2020
use crate::util::hash::DoubleSha256;

stacks-common/src/address/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::{error, fmt};
1919
use sha2::{Digest, Sha256};
2020

2121
use crate::deps_common::bitcoin::blockdata::opcodes::All as btc_opcodes;
22-
use crate::deps_common::bitcoin::blockdata::script::{Builder, Instruction, Script};
22+
use crate::deps_common::bitcoin::blockdata::script::Builder;
2323
use crate::types::PublicKey;
2424
use crate::util::hash::Hash160;
2525

@@ -220,7 +220,6 @@ pub fn public_keys_to_address_hash<K: PublicKey>(
220220
mod test {
221221
use super::*;
222222
use crate::util::hash::*;
223-
use crate::util::log;
224223
use crate::util::secp256k1::Secp256k1PublicKey as PubKey;
225224

226225
struct PubkeyFixture {

stacks-common/src/bitvec.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ mod test {
260260

261261
use super::BitVec;
262262
use crate::codec::StacksMessageCodec;
263-
use crate::util::hash::to_hex;
264263

265264
fn check_set_get(mut input: BitVec<{ u16::MAX }>) {
266265
let original_input = input.clone();

stacks-common/src/deps_common/bitcoin/blockdata/block.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use crate::deps_common::bitcoin::blockdata::transaction::Transaction;
2525
use crate::deps_common::bitcoin::network::constants::Network;
2626
use crate::deps_common::bitcoin::network::encodable::VarInt;
2727
use crate::deps_common::bitcoin::network::serialize::BitcoinHash;
28-
use crate::deps_common::bitcoin::util;
2928
use crate::deps_common::bitcoin::util::hash::Sha256dHash;
3029
use crate::deps_common::bitcoin::util::Error;
3130
use crate::deps_common::bitcoin::util::Error::{SpvBadProofOfWork, SpvBadTarget};

stacks-common/src/deps_common/bitcoin/blockdata/script.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
use std::mem::size_of;
2828
use std::{error, fmt};
2929

30-
use serde;
3130
use sha2::{Digest, Sha256};
3231

3332
use crate::deps_common::bitcoin::blockdata::opcodes;

stacks-common/src/deps_common/bitcoin/blockdata/transaction.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use crate::deps_common::bitcoin::network::serialize::{
3434
self, serialize, BitcoinHash, SimpleDecoder, SimpleEncoder,
3535
};
3636
use crate::deps_common::bitcoin::util::hash::Sha256dHash;
37-
use crate::util::hash::to_hex;
3837

3938
/// A reference to a transaction output
4039
#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)]
@@ -675,7 +674,7 @@ impl SigHashType {
675674

676675
#[cfg(test)]
677676
mod tests {
678-
use super::{SigHashType, Transaction, TxIn};
677+
use super::{Transaction, TxIn};
679678
use crate::deps_common;
680679
use crate::deps_common::bitcoin::blockdata::script::Script;
681680
use crate::deps_common::bitcoin::network::serialize::{deserialize, BitcoinHash};
@@ -690,7 +689,6 @@ mod tests {
690689

691690
#[test]
692691
fn test_is_coinbase() {
693-
use crate::deps_common::bitcoin::blockdata::constants;
694692
use crate::deps_common::bitcoin::network::constants::Network;
695693

696694
let genesis = deps_common::bitcoin::blockdata::constants::genesis_block(Network::Bitcoin);

stacks-common/src/deps_common/bitcoin/network/message_network.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
//!
2020
2121
use crate::deps_common::bitcoin::network::address::Address;
22-
use crate::deps_common::bitcoin::network::constants;
23-
use crate::util;
2422

2523
// Some simple messages
2624

stacks-common/src/deps_common/bitcoin/util/hash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use std::char::from_digit;
1919
use std::cmp::min;
2020
use std::io::{Cursor, Write};
21-
use std::{error, fmt, mem};
21+
use std::{fmt, mem};
2222

2323
use ripemd::Ripemd160;
2424
#[cfg(feature = "serde")]

stacks-common/src/deps_common/httparse/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//! Originally written by Sean McArthur.
3131
//!
3232
//! Modified by Jude Nelson to remove all unsafe code.
33-
use std::{error, fmt, mem, result, str};
33+
use std::{fmt, mem, result, str};
3434

3535
macro_rules! next {
3636
($bytes:ident) => {{
@@ -1282,8 +1282,6 @@ mod tests {
12821282

12831283
#[test]
12841284
fn test_std_error() {
1285-
use std::error::Error as StdError;
1286-
12871285
use super::Error;
12881286
let err = Error::HeaderName;
12891287
assert_eq!(err.to_string(), err.description_str());

stacks-common/src/libcommon.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#![allow(unused_macros)]
2-
#![allow(unused_imports)]
32
#![allow(dead_code)]
43
#![allow(non_camel_case_types)]
54
#![allow(non_snake_case)]
65
#![allow(non_upper_case_globals)]
76
#![cfg_attr(test, allow(unused_variables, unused_assignments))]
87
#![allow(clippy::assertions_on_constants)]
98

9+
#[allow(unused_imports)]
1010
#[macro_use(o, slog_log, slog_trace, slog_debug, slog_info, slog_warn, slog_error)]
1111
extern crate slog;
1212

@@ -33,8 +33,6 @@ pub mod deps_common;
3333

3434
pub mod bitvec;
3535

36-
use crate::types::chainstate::{BlockHeaderHash, BurnchainHeaderHash, SortitionId, StacksBlockId};
37-
3836
pub mod consts {
3937
use crate::types::chainstate::{BlockHeaderHash, ConsensusHash};
4038
pub use crate::types::MINING_COMMITMENT_WINDOW;

0 commit comments

Comments
 (0)