From b02b6584f7da7d22c82f7d9839f55ea38e51de95 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Mon, 4 Dec 2023 19:29:46 -0500 Subject: Rust API : Fix some clippy warnings --- rust/src/mlil/operation.rs | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'rust/src') diff --git a/rust/src/mlil/operation.rs b/rust/src/mlil/operation.rs index 4b234bf1..cdff02b2 100644 --- a/rust/src/mlil/operation.rs +++ b/rust/src/mlil/operation.rs @@ -239,7 +239,7 @@ fn get_var(id: u64) -> Variable { fn get_var_ssa(id: u64, version: usize) -> SSAVariable { let raw = unsafe { BNFromVariableIdentifier(id) }; let var = unsafe { Variable::from_raw(raw) }; - SSAVariable::new(var, version as usize) + SSAVariable::new(var, version) } fn get_call_list( @@ -459,7 +459,7 @@ impl Jump { &self, function: &MediumLevelILFunction, ) -> impl Iterator { - [("dest", MediumLevelILOperand::Expr(self.dest(&function)))].into_iter() + [("dest", MediumLevelILOperand::Expr(self.dest(function)))].into_iter() } } @@ -512,10 +512,10 @@ impl StoreSsa { function: &MediumLevelILFunction, ) -> impl Iterator { [ - ("dest", MediumLevelILOperand::Expr(self.dest(&function))), + ("dest", MediumLevelILOperand::Expr(self.dest(function))), ("dest_memory", MediumLevelILOperand::Int(self.dest_memory())), ("src_memory", MediumLevelILOperand::Int(self.src_memory())), - ("src", MediumLevelILOperand::Expr(self.src(&function))), + ("src", MediumLevelILOperand::Expr(self.src(function))), ] .into_iter() } @@ -2062,9 +2062,7 @@ impl Var { pub fn src(&self) -> Variable { self.src } - pub fn operands( - &self, - ) -> impl Iterator { + pub fn operands(&self) -> impl Iterator { [("src", MediumLevelILOperand::Var(self.src()))].into_iter() } } @@ -2088,9 +2086,7 @@ impl Field { pub fn offset(&self) -> u64 { self.offset } - pub fn operands( - &self, - ) -> impl Iterator { + pub fn operands(&self) -> impl Iterator { [ ("src", MediumLevelILOperand::Var(self.src())), ("offset", MediumLevelILOperand::Int(self.offset())), @@ -2113,9 +2109,7 @@ impl VarSsa { pub fn src(&self) -> SSAVariable { self.src } - pub fn operands( - &self, - ) -> impl Iterator { + pub fn operands(&self) -> impl Iterator { [("src", MediumLevelILOperand::VarSsa(self.src()))].into_iter() } } @@ -2139,9 +2133,7 @@ impl VarSsaField { pub fn offset(&self) -> u64 { self.offset } - pub fn operands( - &self, - ) -> impl Iterator { + pub fn operands(&self) -> impl Iterator { [ ("src", MediumLevelILOperand::VarSsa(self.src())), ("offset", MediumLevelILOperand::Int(self.offset())), @@ -2162,9 +2154,7 @@ impl Trap { pub fn vector(&self) -> u64 { self.vector } - pub fn operands( - &self, - ) -> impl Iterator { + pub fn operands(&self) -> impl Iterator { [("vector", MediumLevelILOperand::Int(self.vector()))].into_iter() } } -- cgit v1.3.1