Skip to content

Commit

Permalink
fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
jsdw committed Jan 28, 2025
1 parent 7b67618 commit 4576c47
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
10 changes: 5 additions & 5 deletions subxt/src/backend/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ pub mod chain_head;
pub mod legacy;
pub mod utils;

use subxt_core::client::RuntimeVersion;

use crate::error::Error;
use crate::metadata::Metadata;
use crate::Config;
Expand All @@ -20,12 +18,14 @@ use codec::{Decode, Encode};
use futures::{Stream, StreamExt};
use std::pin::Pin;
use std::sync::Arc;
use subxt_core::client::RuntimeVersion;

/// Some re-exports from the [`subxt_rpcs`] crate, also accessible in full via [`crate::ext::subxt_rpcs`].
pub mod rpc {
pub use subxt_rpcs::client::{
reconnecting_rpc_client, RawRpcFuture, RawRpcSubscription, RawValue,
};
pub use subxt_rpcs::client::{RawRpcFuture, RawRpcSubscription, RawValue};
crate::macros::cfg_reconnecting_rpc_client! {
pub use subxt_rpcs::client::reconnecting_rpc_client;
}
pub use subxt_rpcs::{RpcClient, RpcClientT};
}

Expand Down
8 changes: 4 additions & 4 deletions subxt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
))]
compile_error!("subxt: exactly one of the 'web' and 'native' features should be used.");

// Internal helper macros
#[macro_use]
mod macros;

// The guide is here.
pub mod book;

Expand Down Expand Up @@ -80,10 +84,6 @@ pub mod dynamic {
};
}

// Internal helper macros
#[macro_use]
mod macros;

// Expose light client bits
cfg_unstable_light_client! {
pub use subxt_lightclient as lightclient;
Expand Down
8 changes: 7 additions & 1 deletion subxt/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ macro_rules! cfg_unstable_light_client {
};
}

macro_rules! cfg_reconnecting_rpc_client {
($($item:item)*) => {
crate::macros::cfg_feature!("reconnecting-rpc-client", $($item)*);
};
}

macro_rules! cfg_jsonrpsee {
($($item:item)*) => {
crate::macros::cfg_feature!("jsonrpsee", $($item)*);
Expand Down Expand Up @@ -50,4 +56,4 @@ pub(crate) use {cfg_feature, cfg_jsonrpsee, cfg_unstable_light_client};

// Only used by light-client.
#[allow(unused)]
pub(crate) use {cfg_jsonrpsee_native, cfg_jsonrpsee_web};
pub(crate) use {cfg_jsonrpsee_native, cfg_jsonrpsee_web, cfg_reconnecting_rpc_client};

0 comments on commit 4576c47

Please sign in to comment.