remove extraneous clones

This commit is contained in:
ConnorSkees 2020-01-17 21:20:56 -05:00
parent 4114cc6f9d
commit 02d6a511a5
3 changed files with 7 additions and 7 deletions

View File

@ -117,8 +117,8 @@ pub fn eat_call_args<I: Iterator<Item = Token>>(toks: &mut Peekable<I>) -> CallA
} }
TokenKind::Symbol(Symbol::CloseParen) => { TokenKind::Symbol(Symbol::CloseParen) => {
args.push(CallArg { args.push(CallArg {
name: name.clone(), name: name,
val: val.clone(), val: val,
}); });
break; break;
} }

View File

@ -274,11 +274,11 @@ impl<'a> StyleSheetParser<'a> {
} }
TokenKind::AtRule(_) => { TokenKind::AtRule(_) => {
if let Some(Token { if let Some(Token {
kind: TokenKind::AtRule(rule), kind: TokenKind::AtRule(ref rule),
pos, pos,
}) = self.lexer.next() }) = self.lexer.next()
{ {
match eat_at_rule(rule, pos, &mut self.lexer, &mut self.global_scope) { match eat_at_rule(rule, pos, &mut self.lexer, &self.global_scope) {
Ok(_) => todo!(), Ok(_) => todo!(),
Err(Printer::Error(pos, message)) => self.error(pos, &message), Err(Printer::Error(pos, message)) => self.error(pos, &message),
Err(Printer::Warn(pos, message)) => self.warn(pos, &message), Err(Printer::Warn(pos, message)) => self.warn(pos, &message),
@ -438,7 +438,7 @@ fn parse_mixin<I: Iterator<Item = Token>>(
} }
fn eat_at_rule<I: Iterator<Item = Token>>( fn eat_at_rule<I: Iterator<Item = Token>>(
rule: AtRule, rule: &AtRule,
pos: Pos, pos: Pos,
toks: &mut Peekable<I>, toks: &mut Peekable<I>,
scope: &Scope, scope: &Scope,
@ -549,7 +549,7 @@ pub(crate) fn eat_expr<I: Iterator<Item = Token>>(
} }
TokenKind::AtRule(_) => { TokenKind::AtRule(_) => {
if let Some(Token { if let Some(Token {
kind: TokenKind::AtRule(rule), kind: TokenKind::AtRule(ref rule),
pos, pos,
}) = toks.next() }) = toks.next()
{ {

View File

@ -16,7 +16,7 @@ pub struct Mixin {
impl Mixin { impl Mixin {
pub fn new(scope: Scope, args: FuncArgs, body: Vec<Token>) -> Self { pub fn new(scope: Scope, args: FuncArgs, body: Vec<Token>) -> Self {
let body = body.clone().into_iter().peekable(); let body = body.into_iter().peekable();
Mixin { Mixin {
scope, scope,
args, args,