Skip to content

Commit

Permalink
Misc rust fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
emesare committed Jan 22, 2025
1 parent 79f287f commit 94bdf81
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion rust/src/low_level_il/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,8 @@ where
visit!(op.source_mem_expr());
}
// Do not have any sub expressions.
Pop(_) | Reg(_) | RegSplit(_) | Const(_) | ConstPtr(_) | Flag(_) | FlagBit(_) | ExternPtr(_) | FlagCond(_) | FlagGroup(_) | Unimpl(_) | Undef(_) => {}
Pop(_) | Reg(_) | RegSplit(_) | Const(_) | ConstPtr(_) | Flag(_) | FlagBit(_)
| ExternPtr(_) | FlagCond(_) | FlagGroup(_) | Unimpl(_) | Undef(_) => {}
}

VisitorAction::Sibling
Expand Down
2 changes: 1 addition & 1 deletion rust/src/low_level_il/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

use super::operation;
use super::operation::Operation;
use super::VisitorAction;
use super::*;
use crate::architecture::Architecture;
use binaryninjacore_sys::BNGetLowLevelILByIndex;
use binaryninjacore_sys::BNGetLowLevelILIndexForInstruction;
use binaryninjacore_sys::BNLowLevelILInstruction;
use std::fmt::{Debug, Display, Formatter};
use super::VisitorAction;

#[repr(transparent)]
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
Expand Down
12 changes: 10 additions & 2 deletions rust/tests/low_level_il.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ fn test_llil_visitor(_session: &Session) {
// This is a flag instruction removed in LLIL.
instructions_visited.push(LowLevelInstructionIndex(38));
for instr_idx in 0..41 {
if instructions_visited.iter().find(|x| x.0 == instr_idx).is_none() {
if instructions_visited
.iter()
.find(|x| x.0 == instr_idx)
.is_none()
{
panic!("Instruction with index {:?} not visited", instr_idx);
};
}
Expand All @@ -215,7 +219,11 @@ fn test_llil_visitor(_session: &Session) {
expressions_visited.push(LowLevelExpressionIndex(116));
expressions_visited.push(LowLevelExpressionIndex(121));
for expr_idx in 0..127 {
if expressions_visited.iter().find(|x| x.0 == expr_idx).is_none() {
if expressions_visited
.iter()
.find(|x| x.0 == expr_idx)
.is_none()
{
panic!("Expression with index {:?} not visited", expr_idx);
};
}
Expand Down

0 comments on commit 94bdf81

Please sign in to comment.