From 95d9313cddc3424c0843be706d0e0f7398b24725 Mon Sep 17 00:00:00 2001 From: NotAFile Date: Mon, 17 Jan 2022 17:37:52 +0100 Subject: [PATCH] clippy fix --- src/frontend.rs | 4 ++-- src/parser.rs | 8 ++++---- src/parser/proc.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/frontend.rs b/src/frontend.rs index 317c8a7..c19fc65 100644 --- a/src/frontend.rs +++ b/src/frontend.rs @@ -75,7 +75,7 @@ fn lower_process_statement( let next_gen_id = format!("${}$next", assig.lhs); module.add_wire(rtlil::Wire::new(&next_gen_id, TODO_WIDTH, None)); - let next_wire = rtlil::SigSpec::Wire(next_gen_id.clone()); + let next_wire = rtlil::SigSpec::Wire(next_gen_id); updates.push(( rtlil::SigSpec::Wire(assig.lhs.to_owned()), next_wire.clone(), @@ -118,7 +118,7 @@ fn lower_process( let mut updates = vec![]; let mut cases = vec![]; for stmt in &process.items { - let case = lower_process_statement(ctx, module, &mut updates, &stmt)?; + let case = lower_process_statement(ctx, module, &mut updates, stmt)?; cases.push(case); } diff --git a/src/parser.rs b/src/parser.rs index bf8bda2..813cc59 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -4,9 +4,9 @@ pub mod proc; use nom::{ branch::alt, bytes::complete::tag, - character::complete::{alpha1, alphanumeric1, char, multispace0, multispace1, u64 as decimal}, + character::complete::{alpha1, alphanumeric1, char, multispace0, u64 as decimal}, combinator::{map, opt, recognize}, - error::{context, ParseError, VerboseError}, + error::{ParseError, VerboseError}, multi::{many0, separated_list0}, sequence::{delimited, pair, preceded, separated_pair, terminated, tuple}, }; @@ -121,7 +121,7 @@ fn operation(input: Span) -> IResult { separated_pair(ws0(expression_nonrecurse), char('^'), ws0(expression)), |(a, b)| Operation::Xor { a, b }, ), - map(preceded(char('~'), expression), |expr| Operation::Not(expr)), + map(preceded(char('~'), expression), Operation::Not), ))(input) } @@ -152,7 +152,7 @@ fn expression(input: Span) -> IResult { /// the portion of the expression grammar that can be parsed without left recursion fn expression_nonrecurse(input: Span) -> IResult { alt(( - map(ws0(decimal), |lit| Expression::Literal(lit)), + map(ws0(decimal), Expression::Literal), map(ws0(call_item), |call| Expression::Call(Box::new(call))), map(ws0(identifier), |ident| { Expression::Ident(*ident.fragment()) diff --git a/src/parser/proc.rs b/src/parser/proc.rs index 4e8ee35..cd7445d 100644 --- a/src/parser/proc.rs +++ b/src/parser/proc.rs @@ -4,7 +4,7 @@ use nom::{ character::complete::char, combinator::map, error::context, - multi::{many1, separated_list0, separated_list1}, + multi::{many1, separated_list1}, sequence::{delimited, separated_pair, tuple}, };