clippy fix

This commit is contained in:
NotAFile 2022-01-17 17:37:52 +01:00
parent 43c27b97e9
commit 95d9313cdd
3 changed files with 7 additions and 7 deletions

View File

@ -75,7 +75,7 @@ fn lower_process_statement(
let next_gen_id = format!("${}$next", assig.lhs); let next_gen_id = format!("${}$next", assig.lhs);
module.add_wire(rtlil::Wire::new(&next_gen_id, TODO_WIDTH, None)); 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(( updates.push((
rtlil::SigSpec::Wire(assig.lhs.to_owned()), rtlil::SigSpec::Wire(assig.lhs.to_owned()),
next_wire.clone(), next_wire.clone(),
@ -118,7 +118,7 @@ fn lower_process(
let mut updates = vec![]; let mut updates = vec![];
let mut cases = vec![]; let mut cases = vec![];
for stmt in &process.items { 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); cases.push(case);
} }

View File

@ -4,9 +4,9 @@ pub mod proc;
use nom::{ use nom::{
branch::alt, branch::alt,
bytes::complete::tag, 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}, combinator::{map, opt, recognize},
error::{context, ParseError, VerboseError}, error::{ParseError, VerboseError},
multi::{many0, separated_list0}, multi::{many0, separated_list0},
sequence::{delimited, pair, preceded, separated_pair, terminated, tuple}, sequence::{delimited, pair, preceded, separated_pair, terminated, tuple},
}; };
@ -121,7 +121,7 @@ fn operation(input: Span) -> IResult<Span, Operation> {
separated_pair(ws0(expression_nonrecurse), char('^'), ws0(expression)), separated_pair(ws0(expression_nonrecurse), char('^'), ws0(expression)),
|(a, b)| Operation::Xor { a, b }, |(a, b)| Operation::Xor { a, b },
), ),
map(preceded(char('~'), expression), |expr| Operation::Not(expr)), map(preceded(char('~'), expression), Operation::Not),
))(input) ))(input)
} }
@ -152,7 +152,7 @@ fn expression(input: Span) -> IResult<Span, Expression> {
/// the portion of the expression grammar that can be parsed without left recursion /// the portion of the expression grammar that can be parsed without left recursion
fn expression_nonrecurse(input: Span) -> IResult<Span, Expression> { fn expression_nonrecurse(input: Span) -> IResult<Span, Expression> {
alt(( 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(call_item), |call| Expression::Call(Box::new(call))),
map(ws0(identifier), |ident| { map(ws0(identifier), |ident| {
Expression::Ident(*ident.fragment()) Expression::Ident(*ident.fragment())

View File

@ -4,7 +4,7 @@ use nom::{
character::complete::char, character::complete::char,
combinator::map, combinator::map,
error::context, error::context,
multi::{many1, separated_list0, separated_list1}, multi::{many1, separated_list1},
sequence::{delimited, separated_pair, tuple}, sequence::{delimited, separated_pair, tuple},
}; };