Simplify FuncArgs::parse.

This commit is contained in:
Stephen Chung 2021-06-29 21:47:55 +08:00
parent d146de4ff9
commit 8b0299077b

View File

@ -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());
} }
} }