@@ -66,8 +66,8 @@ impl DataType {
6666 pub fn display_labels ( & self , endian : object:: Endianness , bytes : & [ u8 ] ) -> Vec < String > {
6767 let mut strs = Vec :: new ( ) ;
6868 for ( literal, label_override) in self . display_literals ( endian, bytes) {
69- let label = label_override. unwrap_or_else ( || format ! ( "{}" , self ) ) ;
70- strs. push ( format ! ( "{}: {}" , label , literal ) )
69+ let label = label_override. unwrap_or_else ( || format ! ( "{self}" ) ) ;
70+ strs. push ( format ! ( "{label }: {literal}" ) )
7171 }
7272 strs
7373 }
@@ -100,31 +100,31 @@ impl DataType {
100100 match self {
101101 DataType :: Int8 => {
102102 let i = i8:: from_ne_bytes ( bytes. try_into ( ) . unwrap ( ) ) ;
103- strs. push ( ( format ! ( "{:#x}" , i ) , None ) ) ;
103+ strs. push ( ( format ! ( "{i :#x}" ) , None ) ) ;
104104
105105 if i < 0 {
106106 strs. push ( ( format ! ( "{:#x}" , ReallySigned ( i) ) , None ) ) ;
107107 }
108108 }
109109 DataType :: Int16 => {
110110 let i = endian. read_i16_bytes ( bytes. try_into ( ) . unwrap ( ) ) ;
111- strs. push ( ( format ! ( "{:#x}" , i ) , None ) ) ;
111+ strs. push ( ( format ! ( "{i :#x}" ) , None ) ) ;
112112
113113 if i < 0 {
114114 strs. push ( ( format ! ( "{:#x}" , ReallySigned ( i) ) , None ) ) ;
115115 }
116116 }
117117 DataType :: Int32 => {
118118 let i = endian. read_i32_bytes ( bytes. try_into ( ) . unwrap ( ) ) ;
119- strs. push ( ( format ! ( "{:#x}" , i ) , None ) ) ;
119+ strs. push ( ( format ! ( "{i :#x}" ) , None ) ) ;
120120
121121 if i < 0 {
122122 strs. push ( ( format ! ( "{:#x}" , ReallySigned ( i) ) , None ) ) ;
123123 }
124124 }
125125 DataType :: Int64 => {
126126 let i = endian. read_i64_bytes ( bytes. try_into ( ) . unwrap ( ) ) ;
127- strs. push ( ( format ! ( "{:#x}" , i ) , None ) ) ;
127+ strs. push ( ( format ! ( "{i :#x}" ) , None ) ) ;
128128
129129 if i < 0 {
130130 strs. push ( ( format ! ( "{:#x}" , ReallySigned ( i) ) , None ) ) ;
@@ -151,16 +151,16 @@ impl DataType {
151151 ) ) ;
152152 }
153153 DataType :: Bytes => {
154- strs. push ( ( format ! ( "{:#?}" , bytes ) , None ) ) ;
154+ strs. push ( ( format ! ( "{bytes :#?}" ) , None ) ) ;
155155 }
156156 DataType :: String => {
157157 if let Ok ( cstr) = CStr :: from_bytes_until_nul ( bytes) {
158- strs. push ( ( format ! ( "{:?}" , cstr ) , None ) ) ;
158+ strs. push ( ( format ! ( "{cstr :?}" ) , None ) ) ;
159159 }
160160 if let Some ( nul_idx) = bytes. iter ( ) . position ( |& c| c == b'\0' ) {
161161 let ( cow, _, had_errors) = SHIFT_JIS . decode ( & bytes[ ..nul_idx] ) ;
162162 if !had_errors {
163- let str = format ! ( "{:?}" , cow ) ;
163+ let str = format ! ( "{cow :?}" ) ;
164164 // Only add the Shift JIS string if it's different from the ASCII string.
165165 if !strs. iter ( ) . any ( |x| x. 0 == str) {
166166 strs. push ( ( str, Some ( "Shift JIS" . into ( ) ) ) ) ;
0 commit comments