From 6ea036581baa4577601b04570bd37fcc0bd30efd Mon Sep 17 00:00:00 2001 From: Connor Skees Date: Tue, 30 Jun 2020 06:53:17 -0400 Subject: [PATCH] mixin stores body as Vec --- src/atrule/mixin.rs | 7 +------ src/parse/mixin.rs | 4 +++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/atrule/mixin.rs b/src/atrule/mixin.rs index 678447d..3d32fc8 100644 --- a/src/atrule/mixin.rs +++ b/src/atrule/mixin.rs @@ -1,14 +1,10 @@ -use std::vec::IntoIter; - -use peekmore::{PeekMore, PeekMoreIterator}; - use crate::{args::FuncArgs, scope::Scope, Token}; #[derive(Debug, Clone)] pub(crate) struct Mixin { pub scope: Scope, pub args: FuncArgs, - pub body: PeekMoreIterator>, + pub body: Vec, pub accepts_content_block: bool, } @@ -19,7 +15,6 @@ impl Mixin { body: Vec, accepts_content_block: bool, ) -> Self { - let body = body.into_iter().peekmore(); Mixin { scope, args, diff --git a/src/parse/mixin.rs b/src/parse/mixin.rs index eb84dfc..9c27086 100644 --- a/src/parse/mixin.rs +++ b/src/parse/mixin.rs @@ -2,6 +2,8 @@ use std::mem; use codemap::Spanned; +use peekmore::PeekMore; + use crate::{ args::{CallArgs, FuncArgs}, atrule::Mixin, @@ -97,7 +99,7 @@ impl<'a> Parser<'a> { self.eval_mixin_args(&mut mixin, args)?; let body = Parser { - toks: &mut mixin.body, + toks: &mut mixin.body.into_iter().peekmore(), map: self.map, path: self.path, scopes: &mut NeverEmptyVec::new(mixin.scope),