Fix clippy warnings.

This commit fixes the current set of (stable) clippy warnings in the repo.
This commit is contained in:
Peter Huene
2019-10-23 23:15:42 -07:00
committed by Andrew Brown
parent 1176e4f178
commit 9f506692c2
93 changed files with 667 additions and 662 deletions

View File

@@ -42,7 +42,7 @@ impl Stack {
pub fn new(regclass: RegClassIndex) -> Self {
Self { regclass }
}
pub fn stack_base_mask(&self) -> &'static str {
pub fn stack_base_mask(self) -> &'static str {
// TODO: Make this configurable instead of just using the SP.
"StackBaseMask(1)"
}
@@ -253,8 +253,8 @@ impl EncodingRecipeBuilder {
}
pub fn build(self) -> EncodingRecipe {
let operands_in = self.operands_in.unwrap_or(Vec::new());
let operands_out = self.operands_out.unwrap_or(Vec::new());
let operands_in = self.operands_in.unwrap_or_default();
let operands_out = self.operands_out.unwrap_or_default();
// The number of input constraints must match the number of format input operands.
if !self.format.has_value_list {
@@ -282,7 +282,7 @@ impl EncodingRecipeBuilder {
let clobbers_flags = self.clobbers_flags.unwrap_or(true);
EncodingRecipe {
name: self.name.into(),
name: self.name,
format: self.format,
base_size: self.base_size,
operands_in,