Simplify FuncArgs::parse.
This commit is contained in:
parent
d146de4ff9
commit
8b0299077b
@ -4,7 +4,7 @@
|
|||||||
#![allow(non_snake_case)]
|
#![allow(non_snake_case)]
|
||||||
|
|
||||||
use crate::dynamic::Variant;
|
use crate::dynamic::Variant;
|
||||||
use crate::{Dynamic, StaticVec};
|
use crate::Dynamic;
|
||||||
#[cfg(feature = "no_std")]
|
#[cfg(feature = "no_std")]
|
||||||
use std::prelude::v1::*;
|
use std::prelude::v1::*;
|
||||||
|
|
||||||
@ -70,13 +70,10 @@ macro_rules! impl_args {
|
|||||||
impl<$($p: Variant + Clone),*> FuncArgs for ($($p,)*)
|
impl<$($p: Variant + Clone),*> FuncArgs for ($($p,)*)
|
||||||
{
|
{
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
|
#[allow(unused_variables)]
|
||||||
fn parse<CONTAINER: Extend<Dynamic>>(self, container: &mut CONTAINER) {
|
fn parse<CONTAINER: Extend<Dynamic>>(self, container: &mut CONTAINER) {
|
||||||
let ($($p,)*) = self;
|
let ($($p,)*) = self;
|
||||||
|
$(container.extend(Some($p.into_dynamic()));)*
|
||||||
let mut _v = StaticVec::new();
|
|
||||||
$(_v.push($p.into_dynamic());)*
|
|
||||||
|
|
||||||
container.extend(_v.into_iter());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user