clippy fix

main
NotAFile 2022-04-05 13:36:00 +02:00
parent 95b64a324a
commit da0d1dd6d8
6 changed files with 9 additions and 17 deletions

View File

@ -1,5 +1,3 @@
use crate::frontend::types::TypeStruct;
use crate::frontend::Callable;
use crate::rtlil;
use crate::rtlil::SigSpec;

View File

@ -347,7 +347,7 @@ impl Context {
let mut new_type = callee_def.ret_type;
if genargs.len() != 0 {
if !genargs.is_empty() {
// need to infer generic arguments
for inf_res in inferred_args {
match inf_res {
@ -370,7 +370,7 @@ impl Context {
let mut new_expr = expr.clone();
new_expr.typ = new_type;
new_expr.kind = typed_ir::ExprKind::Call(typed_ir::Call {
called: call.called.clone(),
called: call.called,
args: args_typed,
genargs,
});
@ -412,7 +412,7 @@ impl Context {
let args = callsig
.args
.iter()
.map(|(name, typ)| {
.map(|(_name, typ)| {
let mut out = String::new();
self.types.pretty_type(&mut out, *typ)?;
Ok(out)
@ -421,7 +421,7 @@ impl Context {
let genargs = callsig
.genargs
.iter()
.map(|(name, typ)| {
.map(|(_name, typ)| {
let mut type_str = String::new();
self.types.pretty_type(&mut type_str, *typ)?;
Ok(type_str)

View File

@ -246,11 +246,7 @@ impl TypingContext {
match kind {
TypeKind::ElabType(_) => todo!(),
TypeKind::Logic(data) => {
if let ElabValue::Concrete(_) = data.value {
true
} else {
false
}
matches!(data.value, ElabValue::Concrete(_))
}
TypeKind::UInt(_) => todo!(),
TypeKind::Callable(_) => todo!(),

View File

@ -1,4 +1,3 @@
use super::declaration::{declaration, NetDecl};
use super::tokens::{token, Token, TokenKind as tk, TokenSpan};
use super::IResult;
use nom::multi::separated_list0;
@ -31,7 +30,7 @@ fn state_variant(input: TokenSpan) -> IResult<TokenSpan, StateVariant> {
)),
)),
|(name, param)| StateVariant {
name: name.clone(),
name,
params: param,
},
)(input)

View File

@ -2,15 +2,14 @@ use nom::{
branch::alt,
combinator::map,
error::context,
multi::{many1, separated_list1},
multi::separated_list1,
sequence::{delimited, separated_pair, tuple},
};
use crate::parser::{
assign_statement, expression,
expression::{expression, Expression},
tokens::{token, TokenKind as tk, TokenSpan},
Assign, IResult, Span,
IResult,
};
#[derive(Debug, Clone)]

View File

@ -6,7 +6,7 @@ use nom::{
branch::alt,
combinator::{map, opt},
multi::separated_list0,
sequence::{delimited, preceded, separated_pair, tuple},
sequence::{delimited, tuple},
};
#[derive(Debug, Clone)]