internals: Fix lint warnings on macro
The new `impl_to_hex_from_lower_hex` macro causes build warnings when `internals` is built without the `alloc` feature. There are two macro implementations depending on feature gates, improve the docs and duplicate them ont both macro definitions.
This commit is contained in:
parent
6fac593ec9
commit
514cc5500f
|
@ -205,7 +205,10 @@ macro_rules! impl_from_infallible {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Implements `to_hex` for functions that have implemented [`core::fmt::LowerHex`]
|
/// Adds an implementation of `pub fn to_hex(&self) -> String` if `alloc` feature is enabled.
|
||||||
|
///
|
||||||
|
/// The added function allocates a `String` then calls through to [`core::fmt::LowerHex`].
|
||||||
|
/// Calling this macro without the `alloc` feature enabled is a noop.
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
#[cfg(feature = "alloc")]
|
#[cfg(feature = "alloc")]
|
||||||
macro_rules! impl_to_hex_from_lower_hex {
|
macro_rules! impl_to_hex_from_lower_hex {
|
||||||
|
@ -224,6 +227,10 @@ macro_rules! impl_to_hex_from_lower_hex {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Adds an implementation of `pub fn to_hex(&self) -> String` if `alloc` feature is enabled.
|
||||||
|
///
|
||||||
|
/// The added function allocates a `String` then calls through to [`core::fmt::LowerHex`].
|
||||||
|
/// Calling this macro without the `alloc` feature enabled is a noop.
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
#[cfg(not(feature = "alloc"))]
|
#[cfg(not(feature = "alloc"))]
|
||||||
macro_rules! impl_to_hex_from_lower_hex {
|
macro_rules! impl_to_hex_from_lower_hex {
|
||||||
|
|
Loading…
Reference in New Issue