mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 08:11:04 +00:00
Fixup some wrong dependencies (#12899)
* Fixup some wrong dependencies Dev dependencies should not appear in the feature list. If features are required, they should be directly enabled for the `dev-dependency`. * More fixups * Fix fix * Remove deprecated feature * Make all work properly and nice!! * FMT * Fix formatting
This commit is contained in:
@@ -622,3 +622,49 @@ macro_rules! bounded_btree_map {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// Generates a macro for checking if a certain feature is enabled.
|
||||
///
|
||||
/// These feature checking macros can be used to conditionally enable/disable code in a dependent
|
||||
/// crate based on a feature in the crate where the macro is called.
|
||||
#[macro_export]
|
||||
// We need to skip formatting this macro because of this bug:
|
||||
// https://github.com/rust-lang/rustfmt/issues/5283
|
||||
#[rustfmt::skip]
|
||||
macro_rules! generate_feature_enabled_macro {
|
||||
( $macro_name:ident, $feature_name:meta, $d:tt ) => {
|
||||
/// Enable/disable the given code depending on
|
||||
#[doc = concat!("`", stringify!($feature_name), "`")]
|
||||
/// being enabled for the crate or not.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```nocompile
|
||||
/// // Will add the code depending on the feature being enabled or not.
|
||||
#[doc = concat!(stringify!($macro_name), "!( println!(\"Hello\") )")]
|
||||
/// ```
|
||||
#[cfg($feature_name)]
|
||||
#[macro_export]
|
||||
macro_rules! $macro_name {
|
||||
( $d ( $d input:tt )* ) => {
|
||||
$d ( $d input )*
|
||||
}
|
||||
}
|
||||
|
||||
/// Enable/disable the given code depending on
|
||||
#[doc = concat!("`", stringify!($feature_name), "`")]
|
||||
/// being enabled for the crate or not.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```nocompile
|
||||
/// // Will add the code depending on the feature being enabled or not.
|
||||
#[doc = concat!(stringify!($macro_name), "!( println!(\"Hello\") )")]
|
||||
/// ```
|
||||
#[cfg(not($feature_name))]
|
||||
#[macro_export]
|
||||
macro_rules! $macro_name {
|
||||
( $d ( $d input:tt )* ) => {};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
|
||||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }
|
||||
sp-core = { version = "7.0.0", default-features = false, path = "../core" }
|
||||
sp-runtime = { version = "7.0.0", default-features = false, path = "../runtime" }
|
||||
sp-std = { version = "5.0.0", default-features = false, path = "../std" }
|
||||
|
||||
@@ -23,6 +24,7 @@ default = ["std"]
|
||||
std = [
|
||||
"codec/std",
|
||||
"scale-info/std",
|
||||
"sp-core/std",
|
||||
"sp-runtime/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
|
||||
@@ -190,3 +190,5 @@ pub trait StakingInterface {
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn set_current_era(era: EraIndex);
|
||||
}
|
||||
|
||||
sp_core::generate_feature_enabled_macro!(runtime_benchmarks_enabled, feature = "runtime-benchmarks", $);
|
||||
|
||||
Reference in New Issue
Block a user