Skip to content

Commit 06749b8

Browse files
committed
Reformat for edition 2024
1 parent 02b343f commit 06749b8

53 files changed

Lines changed: 196 additions & 195 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/analysis/cfa.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ use std::{
55
ops::{Add, AddAssign, BitAnd, Sub},
66
};
77

8-
use anyhow::{bail, ensure, Context, Result};
8+
use anyhow::{Context, Result, bail, ensure};
99
use itertools::Itertools;
1010

1111
use crate::{
1212
analysis::{
13+
RelocationTarget,
1314
executor::{ExecCbData, ExecCbResult, Executor},
1415
slices::{FunctionSlices, TailCallResult},
1516
vm::{BranchTarget, GprValue, StepResult, VM},
16-
RelocationTarget,
1717
},
1818
obj::{
1919
ObjInfo, ObjSection, ObjSectionKind, ObjSymbol, ObjSymbolFlagSet, ObjSymbolFlags,
@@ -312,11 +312,7 @@ impl AnalyzerState {
312312
.functions
313313
.iter()
314314
.filter_map(|(&addr, info)| {
315-
if info.is_unfinalized() {
316-
info.slices.clone().map(|s| (addr, s))
317-
} else {
318-
None
319-
}
315+
if info.is_unfinalized() { info.slices.clone().map(|s| (addr, s)) } else { None }
320316
})
321317
.collect_vec();
322318
for (addr, mut slices) in unfinalized {

src/analysis/executor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::{ensure, Result};
1+
use anyhow::{Result, ensure};
22
use fixedbitset::FixedBitSet;
33
use ppc750cl::Ins;
44

src/analysis/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::{collections::BTreeSet, num::NonZeroU32};
22

3-
use anyhow::{anyhow, bail, ensure, Context, Result};
3+
use anyhow::{Context, Result, anyhow, bail, ensure};
44
use ppc750cl::Ins;
55

66
use crate::{

src/analysis/pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::{bail, ensure, Result};
1+
use anyhow::{Result, bail, ensure};
22
use flagset::FlagSet;
33
use itertools::Itertools;
44
use memchr::memmem;

src/analysis/signatures.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::{anyhow, Result};
1+
use anyhow::{Result, anyhow};
22
use itertools::Itertools;
33

44
use crate::{

src/analysis/slices.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
use std::{
2-
collections::{btree_map, BTreeMap, BTreeSet},
2+
collections::{BTreeMap, BTreeSet, btree_map},
33
ops::Range,
44
};
55

6-
use anyhow::{bail, ensure, Context, Result};
6+
use anyhow::{Context, Result, bail, ensure};
77
use ppc750cl::{Ins, Opcode};
88

99
use crate::{
1010
analysis::{
11+
RelocationTarget,
1112
cfa::{FunctionInfo, SectionAddress},
1213
disassemble,
1314
executor::{ExecCbData, ExecCbResult, Executor},
1415
uniq_jump_table_entries,
15-
vm::{section_address_for, BranchTarget, GprValue, StepResult, VM},
16-
RelocationTarget,
16+
vm::{BranchTarget, GprValue, StepResult, VM, section_address_for},
1717
},
1818
obj::{ObjInfo, ObjKind, ObjSection, ObjSymbolKind},
1919
};
@@ -205,7 +205,11 @@ impl FunctionSlices {
205205
}
206206
};
207207
if invalid_seq {
208-
bail!("Found multiple functions inside a symbol: {:#010X} and {:#010X}. Check symbols.txt?", prologue, addr)
208+
bail!(
209+
"Found multiple functions inside a symbol: {:#010X} and {:#010X}. Check symbols.txt?",
210+
prologue,
211+
addr
212+
)
209213
}
210214
} else {
211215
self.prologue = Some(addr);

src/analysis/tracker.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ use std::{
33
mem::take,
44
};
55

6-
use anyhow::{bail, Result};
6+
use anyhow::{Result, bail};
77
use cwextab::decode_extab;
88
use ppc750cl::Opcode;
99
use tracing::{debug_span, info_span};
1010
use tracing_attributes::instrument;
1111

1212
use crate::{
1313
analysis::{
14+
RelocationTarget,
1415
cfa::SectionAddress,
1516
executor::{ExecCbData, ExecCbResult, Executor},
1617
relocation_target_for, uniq_jump_table_entries,
17-
vm::{is_store_op, BranchTarget, GprValue, StepResult, VM},
18-
RelocationTarget,
18+
vm::{BranchTarget, GprValue, StepResult, VM, is_store_op},
1919
},
2020
obj::{
2121
ObjDataKind, ObjInfo, ObjKind, ObjReloc, ObjRelocKind, ObjSection, ObjSectionKind,

src/analysis/vm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std::num::NonZeroU32;
22

3-
use ppc750cl::{Argument, Ins, Opcode, GPR};
3+
use ppc750cl::{Argument, GPR, Ins, Opcode};
44

55
use crate::{
6-
analysis::{cfa::SectionAddress, relocation_target_for, RelocationTarget},
6+
analysis::{RelocationTarget, cfa::SectionAddress, relocation_target_for},
77
obj::{ObjInfo, ObjKind},
88
};
99

src/argp_version.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! For now, this only adds a --version/-V option which causes early-exit.
55
use std::ffi::OsStr;
66

7-
use argp::{parser::ParseGlobalOptions, EarlyExit, FromArgs, TopLevelCommand};
7+
use argp::{EarlyExit, FromArgs, TopLevelCommand, parser::ParseGlobalOptions};
88

99
struct ArgsOrVersion<T>(T)
1010
where T: FromArgs;

src/cmd/alf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::io::{stdout, Write};
1+
use std::io::{Write, stdout};
22

33
use anyhow::Result;
44
use argp::FromArgs;

0 commit comments

Comments
 (0)