Skip to content

Commit 49db004

Browse files
committed
Fix in preparation for next edition
Use cargo to upgrade from edition 2015 to edition 2018. cargo fix --edition No manual changes made. The result of the command above is just to fix all the use statements by adding `crate::`.
1 parent 4e888de commit 49db004

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

client/src/client.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ use std::iter::FromIterator;
1414
use std::path::PathBuf;
1515
use std::{fmt, result};
1616

17-
use bitcoin;
17+
use crate::bitcoin;
1818
use jsonrpc;
1919
use serde;
2020
use serde_json;
2121

22-
use bitcoin::hashes::hex::{FromHex, ToHex};
23-
use bitcoin::secp256k1::ecdsa::Signature;
24-
use bitcoin::{
22+
use crate::bitcoin::hashes::hex::{FromHex, ToHex};
23+
use crate::bitcoin::secp256k1::ecdsa::Signature;
24+
use crate::bitcoin::{
2525
Address, Amount, Block, BlockHeader, OutPoint, PrivateKey, PublicKey, Script, Transaction,
2626
};
2727
use log::Level::{Debug, Trace, Warn};
2828

29-
use error::*;
30-
use json;
31-
use queryable;
29+
use crate::error::*;
30+
use crate::json;
31+
use crate::queryable;
3232

3333
/// Crate-specific Result type, shorthand for `std::result::Result` with our
3434
/// crate-specific Error type;
@@ -382,7 +382,7 @@ pub trait RpcApi: Sized {
382382
// - 0.18.x returns a "softforks" array and a "bip9_softforks" map.
383383
// - 0.19.x returns a "softforks" map.
384384
Ok(if self.version()? < 190000 {
385-
use Error::UnexpectedStructure as err;
385+
use crate::Error::UnexpectedStructure as err;
386386

387387
// First, remove both incompatible softfork fields.
388388
// We need to scope the mutable ref here for v1.29 borrowck.
@@ -1256,12 +1256,12 @@ fn log_response(cmd: &str, resp: &Result<jsonrpc::Response>) {
12561256
#[cfg(test)]
12571257
mod tests {
12581258
use super::*;
1259-
use bitcoin;
1259+
use crate::bitcoin;
12601260
use serde_json;
12611261

12621262
#[test]
12631263
fn test_raw_tx() {
1264-
use bitcoin::consensus::encode;
1264+
use crate::bitcoin::consensus::encode;
12651265
let client = Client::new("http://localhost/".into(), Auth::None).unwrap();
12661266
let tx: bitcoin::Transaction = encode::deserialize(&Vec::<u8>::from_hex("0200000001586bd02815cf5faabfec986a4e50d25dbee089bd2758621e61c5fab06c334af0000000006b483045022100e85425f6d7c589972ee061413bcf08dc8c8e589ce37b217535a42af924f0e4d602205c9ba9cb14ef15513c9d946fa1c4b797883e748e8c32171bdf6166583946e35c012103dae30a4d7870cd87b45dd53e6012f71318fdd059c1c2623b8cc73f8af287bb2dfeffffff021dc4260c010000001976a914f602e88b2b5901d8aab15ebe4a97cf92ec6e03b388ac00e1f505000000001976a914687ffeffe8cf4e4c038da46a9b1d37db385a472d88acfd211500").unwrap()).unwrap();
12671267

client/src/error.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
use std::{error, fmt, io};
1212

13-
use bitcoin;
14-
use bitcoin::hashes::hex;
15-
use bitcoin::secp256k1;
13+
use crate::bitcoin;
14+
use crate::bitcoin::hashes::hex;
15+
use crate::bitcoin::secp256k1;
1616
use jsonrpc;
1717
use serde_json;
1818

client/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ extern crate serde_json;
2626
pub extern crate jsonrpc;
2727

2828
pub extern crate bitcoincore_rpc_json;
29+
pub use crate::json::bitcoin;
2930
pub use bitcoincore_rpc_json as json;
30-
pub use json::bitcoin;
3131

3232
mod client;
3333
mod error;
3434
mod queryable;
3535

36-
pub use client::*;
37-
pub use error::Error;
38-
pub use queryable::*;
36+
pub use crate::client::*;
37+
pub use crate::error::Error;
38+
pub use crate::queryable::*;

client/src/queryable.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
// If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
99
//
1010

11-
use bitcoin;
11+
use crate::bitcoin;
1212
use serde_json;
1313

14-
use client::Result;
15-
use client::RpcApi;
14+
use crate::client::Result;
15+
use crate::client::RpcApi;
1616

1717
/// A type that can be queried from Bitcoin Core.
1818
pub trait Queryable<C: RpcApi>: Sized {
@@ -44,7 +44,7 @@ impl<C: RpcApi> Queryable<C> for bitcoin::blockdata::transaction::Transaction {
4444
}
4545
}
4646

47-
impl<C: RpcApi> Queryable<C> for Option<::json::GetTxOutResult> {
47+
impl<C: RpcApi> Queryable<C> for Option<crate::json::GetTxOutResult> {
4848
type Id = bitcoin::OutPoint;
4949

5050
fn query(rpc: &C, id: &Self::Id) -> Result<Self> {

integration_test/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use bitcoincore_rpc::json;
2222
use bitcoincore_rpc::jsonrpc::error::Error as JsonRpcError;
2323
use bitcoincore_rpc::{Auth, Client, Error, RpcApi};
2424

25+
use crate::json::BlockStatsFields as BsFields;
2526
use bitcoin::consensus::encode::{deserialize, serialize};
2627
use bitcoin::hashes::hex::{FromHex, ToHex};
2728
use bitcoin::hashes::Hash;
@@ -33,7 +34,6 @@ use bitcoin::{
3334
use bitcoincore_rpc::bitcoincore_rpc_json::{
3435
GetBlockTemplateModes, GetBlockTemplateRules, ScanTxOutRequest,
3536
};
36-
use json::BlockStatsFields as BsFields;
3737

3838
lazy_static! {
3939
static ref SECP: secp256k1::Secp256k1<secp256k1::All> = secp256k1::Secp256k1::new();

0 commit comments

Comments
 (0)