clippy fix

main
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);
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);
}

View File

@ -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<Span, Operation> {
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<Span, Expression> {
/// the portion of the expression grammar that can be parsed without left recursion
fn expression_nonrecurse(input: Span) -> IResult<Span, Expression> {
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())

View File

@ -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},
};