@@ -244,24 +244,27 @@ impl FileMetadata {
244
244
}
245
245
246
246
/// Returns the file metadata about a Puffin file
247
- #[ rustfmt:: skip]
248
247
pub ( crate ) async fn read ( input_file : & InputFile ) -> Result < FileMetadata > {
249
248
let file_read = input_file. reader ( ) . await ?;
250
249
251
250
let first_four_bytes = file_read. read ( 0 ..FileMetadata :: MAGIC_LENGTH . into ( ) ) . await ?;
252
251
FileMetadata :: check_magic ( & first_four_bytes) ?;
253
252
254
253
let input_file_length = input_file. metadata ( ) . await ?. size ;
255
- let footer_payload_length = FileMetadata :: read_footer_payload_length ( & file_read, input_file_length) . await ?;
256
- let footer_bytes = FileMetadata :: read_footer_bytes ( & file_read, input_file_length, footer_payload_length) . await ?;
254
+ let footer_payload_length =
255
+ FileMetadata :: read_footer_payload_length ( & file_read, input_file_length) . await ?;
256
+ let footer_bytes =
257
+ FileMetadata :: read_footer_bytes ( & file_read, input_file_length, footer_payload_length)
258
+ . await ?;
257
259
258
260
let magic_length = usize:: from ( FileMetadata :: MAGIC_LENGTH ) ;
259
261
// check first four bytes of footer
260
262
FileMetadata :: check_magic ( & footer_bytes[ ..magic_length] ) ?;
261
263
// check last four bytes of footer
262
264
FileMetadata :: check_magic ( & footer_bytes[ footer_bytes. len ( ) - magic_length..] ) ?;
263
265
264
- let footer_payload_str = FileMetadata :: extract_footer_payload_as_str ( & footer_bytes, footer_payload_length) ?;
266
+ let footer_payload_str =
267
+ FileMetadata :: extract_footer_payload_as_str ( & footer_bytes, footer_payload_length) ?;
265
268
FileMetadata :: from_json_str ( & footer_payload_str)
266
269
}
267
270
}
0 commit comments