Skip to content

Commit

Permalink
Misc rust formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
emesare committed Jan 13, 2025
1 parent 3edc540 commit 449809f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 1 addition & 4 deletions rust/examples/workflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ fn example_activity(analysis_context: &AnalysisContext) {
llil_instr.visit_tree(&mut |expr, info| {
if let ExprInfo::Const(_op) = info {
// Replace all consts with 0x1337.
println!(
"Replacing llil expression @ 0x{:x} : {}",
instr, expr.index
);
println!("Replacing llil expression @ 0x{:x} : {}", instr, expr.index);
unsafe {
llil.replace_expression(expr.index, llil.const_int(4, 0x1337))
};
Expand Down
4 changes: 3 additions & 1 deletion rust/src/hlil/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,9 @@ impl HighLevelILInstruction {
// TODO: Replace with a From<u32> for RegisterValueType.
// TODO: We might also want to change the type of `op.constant_data_kind`
// TODO: To RegisterValueType and do the conversion when creating instruction.
state: unsafe { std::mem::transmute::<u32, BNRegisterValueType>(op.constant_data_kind) },
state: unsafe {
std::mem::transmute::<u32, BNRegisterValueType>(op.constant_data_kind)
},
value: op.constant_data_value,
offset: 0,
size: op.size,
Expand Down
4 changes: 3 additions & 1 deletion rust/src/mlil/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,9 @@ impl MediumLevelILInstruction {
// TODO: Replace with a From<u32> for RegisterValueType.
// TODO: We might also want to change the type of `op.constant_data_kind`
// TODO: To RegisterValueType and do the conversion when creating instruction.
state: unsafe { std::mem::transmute::<u32, BNRegisterValueType>(op.constant_data_kind) },
state: unsafe {
std::mem::transmute::<u32, BNRegisterValueType>(op.constant_data_kind)
},
value: op.constant_data_value,
offset: 0,
size: op.size,
Expand Down
2 changes: 1 addition & 1 deletion rust/src/typecontainer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ impl TypeContainer {

/// Parse an entire block of source into types, variables, and functions, with
/// knowledge of the types in the Type Container.
///
///
/// * `source` - Source code to parse
/// * `file_name` - Name of the file containing the source (optional: exists on disk)
/// * `options` - String arguments to pass as options, e.g. command line arguments
Expand Down

0 comments on commit 449809f

Please sign in to comment.