Skip to content

Commit 0f4904a

Browse files
committed
Run nightly rustfmt
1 parent 78d1e1f commit 0f4904a

File tree

4 files changed

+14
-29
lines changed

4 files changed

+14
-29
lines changed

objdiff-core/src/arch/arm.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,10 @@ impl ObjArchArm {
4848
s.kind() == SectionKind::Elf(SHT_ARM_ATTRIBUTES) && s.name() == Ok(".ARM.attributes")
4949
}) {
5050
let attr_data = arm_attrs.uncompressed_data()?;
51-
let build_attrs = BuildAttrs::new(
52-
&attr_data,
53-
match file.endianness() {
54-
object::Endianness::Little => arm_attr::Endian::Little,
55-
object::Endianness::Big => arm_attr::Endian::Big,
56-
},
57-
)?;
51+
let build_attrs = BuildAttrs::new(&attr_data, match file.endianness() {
52+
object::Endianness::Little => arm_attr::Endian::Little,
53+
object::Endianness::Big => arm_attr::Endian::Big,
54+
})?;
5855
for subsection in build_attrs.subsections() {
5956
let subsection = subsection?;
6057
if !subsection.is_aeabi() {

objdiff-core/src/arch/mod.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,11 @@ pub trait ObjArch: Send + Sync {
3636
reloc: &Relocation,
3737
) -> Result<i64>;
3838

39-
fn demangle(&self, _name: &str) -> Option<String> {
40-
None
41-
}
39+
fn demangle(&self, _name: &str) -> Option<String> { None }
4240

4341
fn display_reloc(&self, flags: RelocationFlags) -> Cow<'static, str>;
4442

45-
fn symbol_address(&self, symbol: &Symbol) -> u64 {
46-
symbol.address()
47-
}
43+
fn symbol_address(&self, symbol: &Symbol) -> u64 { symbol.address() }
4844
}
4945

5046
pub struct ProcessCodeResult {

objdiff-core/src/arch/ppc.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,12 @@ fn is_rel_abs_arg(arg: &Argument) -> bool {
2020
matches!(arg, Argument::Uimm(_) | Argument::Simm(_) | Argument::Offset(_))
2121
}
2222

23-
fn is_offset_arg(arg: &Argument) -> bool {
24-
matches!(arg, Argument::Offset(_))
25-
}
23+
fn is_offset_arg(arg: &Argument) -> bool { matches!(arg, Argument::Offset(_)) }
2624

2725
pub struct ObjArchPpc {}
2826

2927
impl ObjArchPpc {
30-
pub fn new(_file: &File) -> Result<Self> {
31-
Ok(Self {})
32-
}
28+
pub fn new(_file: &File) -> Result<Self> { Ok(Self {}) }
3329
}
3430

3531
impl ObjArch for ObjArchPpc {

objdiff-core/src/arch/x86.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -262,12 +262,9 @@ impl FormatterOutput for InstructionFormatterOutput {
262262
match kind {
263263
FormatterTextKind::LabelAddress => {
264264
if let Some(reloc) = self.ins.reloc.as_ref() {
265-
if matches!(
266-
reloc.flags,
267-
RelocationFlags::Coff {
268-
typ: pe::IMAGE_REL_I386_DIR32 | pe::IMAGE_REL_I386_REL32
269-
}
270-
) {
265+
if matches!(reloc.flags, RelocationFlags::Coff {
266+
typ: pe::IMAGE_REL_I386_DIR32 | pe::IMAGE_REL_I386_REL32
267+
}) {
271268
self.ins.args.push(ObjInsArg::Reloc);
272269
return;
273270
} else if self.error.is_none() {
@@ -283,10 +280,9 @@ impl FormatterOutput for InstructionFormatterOutput {
283280
}
284281
FormatterTextKind::FunctionAddress => {
285282
if let Some(reloc) = self.ins.reloc.as_ref() {
286-
if matches!(
287-
reloc.flags,
288-
RelocationFlags::Coff { typ: pe::IMAGE_REL_I386_REL32 }
289-
) {
283+
if matches!(reloc.flags, RelocationFlags::Coff {
284+
typ: pe::IMAGE_REL_I386_REL32
285+
}) {
290286
self.ins.args.push(ObjInsArg::Reloc);
291287
return;
292288
} else if self.error.is_none() {

0 commit comments

Comments
 (0)