mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-24 12:27:59 +00:00
5a0682c1e0
* replace derive_more's 'From' in signer * replace derive_more's 'From' in core * Remove `derive_more`'s `Display` usages (#1601) * Remove derive_more's 'Display' from core * Remove derive_more's 'Display' from metadata * Remove derive_more's 'Display' from signer * Remove derive_more from dependencies (#1602) closes #1503 * Update signer/src/eth.rs Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com> * rename convert_error to impl_from * rename convert_error to impl_from in core --------- Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
32 lines
781 B
Rust
32 lines
781 B
Rust
// Copyright 2019-2024 Parity Technologies (UK) Ltd.
|
|
// This file is dual-licensed as Apache-2.0 or GPL-3.0.
|
|
// see LICENSE for license details.
|
|
|
|
macro_rules! cfg_feature {
|
|
($feature:literal, $($item:item)*) => {
|
|
$(
|
|
#[cfg(feature = $feature)]
|
|
#[cfg_attr(docsrs, doc(cfg(feature = $feature)))]
|
|
$item
|
|
)*
|
|
}
|
|
}
|
|
|
|
macro_rules! cfg_substrate_compat {
|
|
($($item:item)*) => {
|
|
crate::macros::cfg_feature!("substrate-compat", $($item)*);
|
|
};
|
|
}
|
|
|
|
macro_rules! impl_from {
|
|
($module_path:path => $delegate_ty:ident :: $variant:ident) => {
|
|
impl From<$module_path> for $delegate_ty {
|
|
fn from(val: $module_path) -> Self {
|
|
$delegate_ty::$variant(val.into())
|
|
}
|
|
}
|
|
};
|
|
}
|
|
|
|
pub(crate) use {cfg_feature, cfg_substrate_compat};
|