Fix clippy

This commit is contained in:
Richard Patel 2021-08-15 19:42:26 +02:00
parent 5052f260e2
commit 4bb6a5d488
3 changed files with 11 additions and 16 deletions

View File

@ -1,3 +1,5 @@
#![allow(clippy::bad_bit_mask)]
use crate::{bit, bits};
use ppc750cl_macros::isa;

View File

@ -502,8 +502,8 @@ impl Ins {
};
// TODO avoid string concatenation
out.write_mnemonic(&(mnemonic_base.to_owned() + bname))?;
out.write_aa(self.aa())?;
out.write_lk(self.lk())?;
out.write_aa(self.aa())?;
if bname.is_empty() {
out.write_opcode_separator()?;
if self.crf_s() != 0 {
@ -511,11 +511,9 @@ impl Ins {
out.write_operand_separator()?;
}
out.write_branch_target(self.bd(), self.addr)?;
} else {
if self.crf_s() != 0 {
out.write_opcode_separator()?;
out.write_cr(self.bi() >> 2)?;
}
} else if self.crf_s() != 0 {
out.write_opcode_separator()?;
out.write_cr(self.bi() >> 2)?;
}
}
} else {
@ -537,8 +535,8 @@ impl Ins {
};
// TODO avoid string concatenation
out.write_mnemonic(&(mnemonic_base.to_owned() + bname))?;
out.write_aa(self.aa())?;
out.write_lk(self.lk())?;
out.write_aa(self.aa())?;
if bname.is_empty() {
out.write_opcode_separator()?;
if (self.bo() & 16) == 0 {
@ -546,11 +544,9 @@ impl Ins {
out.write_operand_separator()?;
}
out.write_branch_target(self.bd(), self.addr)?;
} else {
if (self.bo() & 16) == 0 {
out.write_opcode_separator()?;
out.write_mode(self.bi())?;
}
} else if (self.bo() & 16) == 0 {
out.write_opcode_separator()?;
out.write_mode(self.bi())?;
}
}
Ok(())

View File

@ -57,10 +57,7 @@ impl Parse for Argument {
.parse_terminated::<Expr, syn::token::Comma>(Expr::parse)?
.into_iter()
.collect();
} else if lookahead.peek(syn::LitStr) {
let expr = input.parse::<ExprLit>()?.into();
sources = vec![expr];
} else if lookahead.peek(syn::LitInt) {
} else if lookahead.peek(syn::LitStr) || lookahead.peek(syn::LitInt) {
let expr = input.parse::<ExprLit>()?.into();
sources = vec![expr];
} else {