@@ -21,7 +21,9 @@ use crate::{
2121pub struct ArchArm64 { }
2222
2323impl ArchArm64 {
24- pub fn new ( _file : & object:: File ) -> Result < Self > { Ok ( Self { } ) }
24+ pub fn new ( _file : & object:: File ) -> Result < Self > {
25+ Ok ( Self { } )
26+ }
2527}
2628
2729impl Arch for ArchArm64 {
@@ -186,7 +188,9 @@ struct DisplayCtx<'a> {
186188// Reworked for more structured output. The library only gives us a Display impl, and no way to
187189// capture any of this information, so it needs to be reimplemented here.
188190fn display_instruction < Cb > ( args : & mut Cb , ins : & Instruction , ctx : & mut DisplayCtx ) -> & ' static str
189- where Cb : FnMut ( InstructionPart < ' static > ) {
191+ where
192+ Cb : FnMut ( InstructionPart < ' static > ) ,
193+ {
190194 let mnemonic = match ins. opcode {
191195 Opcode :: Invalid => return "<invalid>" ,
192196 Opcode :: UDF => "udf" ,
@@ -2001,13 +2005,17 @@ fn condition_code(cond: u8) -> &'static str {
20012005
20022006#[ inline]
20032007fn push_register < Cb > ( args : & mut Cb , size : SizeCode , reg : u16 , sp : bool )
2004- where Cb : FnMut ( InstructionPart < ' static > ) {
2008+ where
2009+ Cb : FnMut ( InstructionPart < ' static > ) ,
2010+ {
20052011 push_opaque ( args, reg_name ( size, reg, sp) ) ;
20062012}
20072013
20082014#[ inline]
20092015fn push_shift < Cb > ( args : & mut Cb , style : ShiftStyle , amount : u8 )
2010- where Cb : FnMut ( InstructionPart < ' static > ) {
2016+ where
2017+ Cb : FnMut ( InstructionPart < ' static > ) ,
2018+ {
20112019 push_opaque ( args, shift_style ( style) ) ;
20122020 if amount != 0 {
20132021 push_plain ( args, " " ) ;
@@ -2017,12 +2025,16 @@ where Cb: FnMut(InstructionPart<'static>) {
20172025
20182026#[ inline]
20192027fn push_condition_code < Cb > ( args : & mut Cb , cond : u8 )
2020- where Cb : FnMut ( InstructionPart < ' static > ) {
2028+ where
2029+ Cb : FnMut ( InstructionPart < ' static > ) ,
2030+ {
20212031 push_opaque ( args, condition_code ( cond) ) ;
20222032}
20232033
20242034fn push_barrier < Cb > ( args : & mut Cb , option : u8 )
2025- where Cb : FnMut ( InstructionPart < ' static > ) {
2035+ where
2036+ Cb : FnMut ( InstructionPart < ' static > ) ,
2037+ {
20262038 match option {
20272039 0b0001 => push_opaque ( args, "oshld" ) ,
20282040 0b0010 => push_opaque ( args, "oshst" ) ,
@@ -2042,32 +2054,42 @@ where Cb: FnMut(InstructionPart<'static>) {
20422054
20432055#[ inline]
20442056fn push_opaque < ' a , Cb > ( args : & mut Cb , text : & ' a str )
2045- where Cb : FnMut ( InstructionPart < ' a > ) {
2057+ where
2058+ Cb : FnMut ( InstructionPart < ' a > ) ,
2059+ {
20462060 args ( InstructionPart :: opaque ( text) ) ;
20472061}
20482062
20492063#[ inline]
20502064fn push_plain < Cb > ( args : & mut Cb , text : & ' static str )
2051- where Cb : FnMut ( InstructionPart < ' static > ) {
2065+ where
2066+ Cb : FnMut ( InstructionPart < ' static > ) ,
2067+ {
20522068 args ( InstructionPart :: basic ( text) ) ;
20532069}
20542070
20552071#[ inline]
20562072fn push_separator < Cb > ( args : & mut Cb )
2057- where Cb : FnMut ( InstructionPart < ' static > ) {
2073+ where
2074+ Cb : FnMut ( InstructionPart < ' static > ) ,
2075+ {
20582076 args ( InstructionPart :: separator ( ) ) ;
20592077}
20602078
20612079#[ inline]
20622080fn push_unsigned < Cb > ( args : & mut Cb , v : u64 )
2063- where Cb : FnMut ( InstructionPart < ' static > ) {
2081+ where
2082+ Cb : FnMut ( InstructionPart < ' static > ) ,
2083+ {
20642084 push_plain ( args, "#" ) ;
20652085 args ( InstructionPart :: unsigned ( v) ) ;
20662086}
20672087
20682088#[ inline]
20692089fn push_signed < Cb > ( args : & mut Cb , v : i64 )
2070- where Cb : FnMut ( InstructionPart < ' static > ) {
2090+ where
2091+ Cb : FnMut ( InstructionPart < ' static > ) ,
2092+ {
20712093 push_plain ( args, "#" ) ;
20722094 args ( InstructionPart :: signed ( v) ) ;
20732095}
@@ -2107,7 +2129,9 @@ fn is_reg_index_reloc(resolved: Option<ResolvedRelocation>) -> bool {
21072129}
21082130
21092131fn push_operand < Cb > ( args : & mut Cb , o : & Operand , ctx : & mut DisplayCtx )
2110- where Cb : FnMut ( InstructionPart < ' static > ) {
2132+ where
2133+ Cb : FnMut ( InstructionPart < ' static > ) ,
2134+ {
21112135 match o {
21122136 Operand :: Nothing => unreachable ! ( ) ,
21132137 Operand :: PCOffset ( off) => {
0 commit comments