@@ -99,7 +99,7 @@ fn disassemble_block(mut pos: Unsigned18Bit, block: &[Unsigned36Bit]) {
9999
100100fn disassemble_word ( loc : Unsigned18Bit , w : Unsigned36Bit , is_origin : bool ) {
101101 if is_origin {
102- print ! ( "{:>06o}|" , loc ) ;
102+ print ! ( "{loc :>06o}|" ) ;
103103 } else {
104104 print ! ( "{:7}" , "" ) ;
105105 }
@@ -113,7 +113,7 @@ fn disassemble_word(loc: Unsigned18Bit, w: Unsigned36Bit, is_origin: bool) {
113113 }
114114 }
115115 let ( left, right) = split_halves ( w) ;
116- println ! ( "|{:>06o} {:>06o}|{:>6o}" , left , right , loc ) ;
116+ println ! ( "|{left :>06o} {right :>06o}|{loc :>6o}" ) ;
117117}
118118
119119fn disassemble_chunk < R : Read > ( input : & mut R , checksum : & mut Signed18Bit ) -> Result < bool , Fail > {
@@ -134,7 +134,7 @@ fn disassemble_chunk<R: Read>(input: &mut R, checksum: &mut Signed18Bit) -> Resu
134134 None => None ,
135135 }
136136 . expect ( "overflow in block length" ) ;
137- println ! ( "** {}-word chunk ending at {}" , len , end ) ;
137+ println ! ( "** {len }-word chunk ending at {end}" ) ;
138138 let u_origin = end
139139 . checked_sub ( len)
140140 . and_then ( |n| n. checked_add ( Unsigned18Bit :: ONE ) )
@@ -155,11 +155,10 @@ fn disassemble_chunk<R: Read>(input: &mut R, checksum: &mut Signed18Bit) -> Resu
155155 {
156156 let unsigned_checksum = checksum. reinterpret_as_unsigned ( ) ;
157157 if unsigned_checksum. is_zero ( ) {
158- println ! ( "** Checksum is valid: {:>06o}" , unsigned_checksum ) ;
158+ println ! ( "** Checksum is valid: {unsigned_checksum :>06o}" ) ;
159159 } else {
160160 println ! (
161- "** Checksum is not valid: {:>06o}, this tape cannot be loaded as-is" ,
162- unsigned_checksum
161+ "** Checksum is not valid: {unsigned_checksum:>06o}, this tape cannot be loaded as-is" ,
163162 ) ;
164163 }
165164 }
@@ -169,7 +168,7 @@ fn disassemble_chunk<R: Read>(input: &mut R, checksum: &mut Signed18Bit) -> Resu
169168 println ! ( "** This is the final block" ) ;
170169 Ok ( false )
171170 } else {
172- eprintln ! ( "warning: block has unexpected next-address {:o}" , next ) ;
171+ eprintln ! ( "warning: block has unexpected next-address {next :o}" ) ;
173172 Ok ( false )
174173 }
175174}
@@ -181,8 +180,7 @@ fn check_header<R: Read>(input: &mut R) -> Result<(), Fail> {
181180 if want != got {
182181 return Err ( Fail :: Generic (
183182 format ! (
184- "File does not begin with the expected header; at position {} we expected {:>012o} but got {:>012o}" ,
185- pos, want, got) ) ) ;
183+ "File does not begin with the expected header; at position {pos} we expected {want:>012o} but got {got:>012o}" ) ) ) ;
186184 }
187185 }
188186 println ! ( "** reader leader is valid:" ) ;
@@ -195,7 +193,7 @@ fn disassemble_file(input_file_name: &OsStr) -> Result<(), Fail> {
195193 let input_file = OpenOptions :: new ( )
196194 . read ( true )
197195 . open ( input_file_name)
198- . map_err ( |e| Fail :: Generic ( format ! ( "failed to open input file: {}" , e ) ) ) ?;
196+ . map_err ( |e| Fail :: Generic ( format ! ( "failed to open input file: {e}" ) ) ) ?;
199197 let mut reader = BufReader :: new ( input_file) ;
200198 check_header ( & mut reader) ?;
201199 let mut checksum: Signed18Bit = Signed18Bit :: ZERO ;
@@ -249,7 +247,7 @@ fn disassemble() -> Result<(), Fail> {
249247 {
250248 Err ( e) => {
251249 return Err ( Fail :: Generic (
252- format ! ( "failed to initialise tracing filter (perhaps there is a problem with environment variables): {}" , e ) ) ) ;
250+ format ! ( "failed to initialise tracing filter (perhaps there is a problem with environment variables): {e}" ) ) ) ;
253251 }
254252 Ok ( layer) => layer,
255253 } ;
@@ -267,7 +265,7 @@ fn disassemble() -> Result<(), Fail> {
267265fn main ( ) {
268266 match disassemble ( ) {
269267 Err ( e) => {
270- eprintln ! ( "error: {}" , e ) ;
268+ eprintln ! ( "error: {e}" ) ;
271269 std:: process:: exit ( 1 ) ;
272270 }
273271 Ok ( ( ) ) => {
0 commit comments