Fix static analysis warnings
This commit is contained in:
@@ -79,7 +79,7 @@ impl InstructionGroup {
|
|||||||
pub fn by_name(&self, name: &'static str) -> &Instruction {
|
pub fn by_name(&self, name: &'static str) -> &Instruction {
|
||||||
self.instructions
|
self.instructions
|
||||||
.iter()
|
.iter()
|
||||||
.find(|inst| inst.name == name)
|
.find(|inst| &inst.name == name)
|
||||||
.expect(&format!("unexisting instruction with name {}", name))
|
.expect(&format!("unexisting instruction with name {}", name))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -155,7 +155,7 @@ impl ops::Deref for Instruction {
|
|||||||
|
|
||||||
impl Instruction {
|
impl Instruction {
|
||||||
pub fn snake_name(&self) -> &str {
|
pub fn snake_name(&self) -> &str {
|
||||||
if self.name == "return" {
|
if &self.name == "return" {
|
||||||
"return_"
|
"return_"
|
||||||
} else {
|
} else {
|
||||||
&self.name
|
&self.name
|
||||||
@@ -800,7 +800,7 @@ impl InstructionPredicateNode {
|
|||||||
ret.extend(node.collect_leaves());
|
ret.extend(node.collect_leaves());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => ret.push(&self),
|
_ => ret.push(self),
|
||||||
}
|
}
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ impl<'builder> RecipeGroup<'builder> {
|
|||||||
pub fn recipe(&self, name: &str) -> &EncodingRecipe {
|
pub fn recipe(&self, name: &str) -> &EncodingRecipe {
|
||||||
self.recipes
|
self.recipes
|
||||||
.iter()
|
.iter()
|
||||||
.find(|recipe| recipe.name == name)
|
.find(|recipe| &recipe.name == name)
|
||||||
.expect(&format!("unknown recipe name: {}. Try template?", name))
|
.expect(&format!("unknown recipe name: {}. Try template?", name))
|
||||||
}
|
}
|
||||||
pub fn template(&self, name: &str) -> &Template {
|
pub fn template(&self, name: &str) -> &Template {
|
||||||
|
|||||||
Reference in New Issue
Block a user