Skip to content

Commit 7f12241

Browse files
committed
Use crate::prelude::* rather than specific imports
New rustc beta now warns on duplicate imports when one of the imports is from a wildcard import or the default prelude. Thus, to avoid this here we prefer to always use `crate::prelude::*` and let it decide if we actually need to import anything.
1 parent 25a7fd1 commit 7f12241

File tree

7 files changed

+3
-9
lines changed

7 files changed

+3
-9
lines changed

lightning/src/chain/chaininterface.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
//! disconnections, transaction broadcasting, and feerate information requests.
1515
1616
use core::{cmp, ops::Deref};
17-
use core::convert::TryInto;
17+
18+
use crate::prelude::*;
1819

1920
use bitcoin::blockdata::transaction::Transaction;
2021

lightning/src/chain/channelmonitor.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ use crate::events::bump_transaction::{AnchorDescriptor, BumpTransactionEvent};
5656
use crate::prelude::*;
5757
use core::{cmp, mem};
5858
use crate::io::{self, Error};
59-
use core::convert::TryInto;
6059
use core::ops::Deref;
6160
use crate::sync::{Mutex, LockTestExt};
6261

lightning/src/routing/gossip.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ use crate::io;
3838
use crate::io_extras::{copy, sink};
3939
use crate::prelude::*;
4040
use core::{cmp, fmt};
41-
use core::convert::TryFrom;
4241
use crate::sync::{RwLock, RwLockReadGuard, LockTestExt};
4342
#[cfg(feature = "std")]
4443
use core::sync::atomic::{AtomicUsize, Ordering};

lightning/src/util/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
//! Error types live here.
1111
1212
use crate::ln::script::ShutdownScript;
13+
use crate::prelude::*;
1314

14-
use alloc::string::String;
1515
use core::fmt;
1616

1717
/// Indicates an error on the client's part (usually some variant of attempting to use too-low or

lightning/src/util/indexed_map.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! This module has a map which can be iterated in a deterministic order. See the [`IndexedMap`].
22
33
use crate::prelude::*;
4-
use alloc::vec::Vec;
54
use alloc::slice::Iter;
65
use core::hash::Hash;
76
use core::cmp::Ord;

lightning/src/util/persist.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@
99
//! and [`ChannelMonitor`] all in one place.
1010
1111
use core::cmp;
12-
use core::convert::{TryFrom, TryInto};
1312
use core::ops::Deref;
1413
use core::str::FromStr;
1514
use bitcoin::{BlockHash, Txid};
1615

1716
use crate::{io, log_error};
18-
use crate::alloc::string::ToString;
1917
use crate::prelude::*;
2018

2119
use crate::chain;

lightning/src/util/ser.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use crate::io_extras::{copy, sink};
1919
use core::hash::Hash;
2020
use crate::sync::{Mutex, RwLock};
2121
use core::cmp;
22-
use core::convert::TryFrom;
2322
use core::ops::Deref;
2423

2524
use alloc::collections::BTreeMap;
@@ -35,7 +34,6 @@ use bitcoin::{consensus, Witness};
3534
use bitcoin::consensus::Encodable;
3635
use bitcoin::hashes::sha256d::Hash as Sha256dHash;
3736
use bitcoin::hash_types::{Txid, BlockHash};
38-
use core::marker::Sized;
3937
use core::time::Duration;
4038
use crate::chain::ClaimId;
4139
use crate::ln::msgs::DecodeError;

0 commit comments

Comments
 (0)