Move all functions metadata into metadata feature.

This commit is contained in:
Stephen Chung
2021-03-24 19:27:38 +08:00
parent c4fe1782df
commit ac7f35cacb
11 changed files with 110 additions and 75 deletions

View File

@@ -142,8 +142,10 @@ macro_rules! reg_range {
($lib:ident | $x:expr => $( $y:ty ),*) => {
$(
$lib.set_iterator::<Range<$y>>();
let hash = $lib.set_native_fn($x, get_range::<$y>);
$lib.update_fn_metadata(hash, &[
let _hash = $lib.set_native_fn($x, get_range::<$y>);
#[cfg(feature = "metadata")]
$lib.update_fn_metadata(_hash, &[
concat!("from: ", stringify!($y)),
concat!("to: ", stringify!($y)),
concat!("Iterator<Item=", stringify!($y), ">")
@@ -153,8 +155,10 @@ macro_rules! reg_range {
($lib:ident | step $x:expr => $( $y:ty ),*) => {
$(
$lib.set_iterator::<StepRange<$y>>();
let hash = $lib.set_native_fn($x, get_step_range::<$y>);
$lib.update_fn_metadata(hash, &[
let _hash = $lib.set_native_fn($x, get_step_range::<$y>);
#[cfg(feature = "metadata")]
$lib.update_fn_metadata(_hash, &[
concat!("from: ", stringify!($y)),
concat!("to: ", stringify!($y)),
concat!("step: ", stringify!($y)),