Skip to content

Commit

Permalink
chore: set rust edition to 2021
Browse files Browse the repository at this point in the history
  • Loading branch information
notmandatory committed Jul 31, 2024
1 parent 746a0e6 commit 84f4f60
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ description = "Bitcoin Electrum client library. Supports plaintext, TLS and Onio
keywords = ["bitcoin", "electrum"]
readme = "README.md"
rust-version = "1.63.0"
edition = "2021"

# loosely based on https://github.com/evgeniy-scherbina/rust-electrumx-client

Expand Down
4 changes: 2 additions & 2 deletions src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::convert::TryInto;
use bitcoin::consensus::encode::{deserialize, serialize};
use bitcoin::{block, Script, Transaction, Txid};

use batch::Batch;
use types::*;
use crate::batch::Batch;
use crate::types::*;

/// API calls exposed by an Electrum client
pub trait ElectrumApi {
Expand Down
2 changes: 1 addition & 1 deletion src/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use bitcoin::{Script, Txid};

use types::{Call, Param, ToElectrumScriptHash};
use crate::types::{Call, Param, ToElectrumScriptHash};

/// Helper structure that caches all the requests before they are actually sent to the server.
///
Expand Down
10 changes: 5 additions & 5 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ use log::{info, warn};

use bitcoin::{Script, Txid};

use api::ElectrumApi;
use batch::Batch;
use config::Config;
use raw_client::*;
use crate::api::ElectrumApi;
use crate::batch::Batch;
use crate::config::Config;
use crate::raw_client::*;
use crate::types::*;
use std::convert::TryFrom;
use types::*;

/// Generalized Electrum client that supports multiple backends. This wraps
/// [`RawClient`](client/struct.RawClient.html) and provides a more user-friendly
Expand Down
10 changes: 5 additions & 5 deletions src/raw_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ use rustls::{
#[cfg(any(feature = "default", feature = "proxy"))]
use crate::socks::{Socks5Stream, TargetAddr, ToTargetAddr};

use stream::ClonableStream;
use crate::stream::ClonableStream;

use api::ElectrumApi;
use batch::Batch;
use types::*;
use crate::api::ElectrumApi;
use crate::batch::Batch;
use crate::types::*;

macro_rules! impl_batch_call {
( $self:expr, $data:expr, $call:ident ) => {{
Expand Down Expand Up @@ -298,7 +298,7 @@ impl RawClient<ElectrumSslStream> {
not(feature = "use-openssl")
))]
mod danger {
use raw_client::ServerName;
use crate::raw_client::ServerName;
use rustls::client::danger::ServerCertVerified;
use rustls::pki_types::CertificateDer;
use rustls::pki_types::UnixTime;
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Utilities helping to handle Electrum-related data.

use crate::types::GetMerkleRes;
use bitcoin::hash_types::TxMerkleNode;
use bitcoin::hashes::sha256d::Hash as Sha256d;
use bitcoin::hashes::{Hash, HashEngine};
use bitcoin::Txid;
use types::GetMerkleRes;

/// Verifies a Merkle inclusion proof as retrieved via [`transaction_get_merkle`] for a transaction with the
/// given `txid` and `merkle_root` as included in the [`BlockHeader`].
Expand Down

0 comments on commit 84f4f60

Please sign in to comment.