@@ -149,7 +149,7 @@ pub enum Error {
149
149
#[ error( "failed to read file: {0}" ) ]
150
150
FileNotFound ( AbsoluteSystemPathBuf ) ,
151
151
#[ error( "failed to write to file: {0}" ) ]
152
- FileWriteError ( AbsoluteSystemPathBuf ) ,
152
+ FileWrite ( AbsoluteSystemPathBuf ) ,
153
153
}
154
154
155
155
impl BoundariesDiagnostic {
@@ -492,7 +492,7 @@ impl Run {
492
492
// Deduplicate and sort by offset
493
493
let file_patches = file_patches
494
494
. into_iter ( )
495
- . map ( |( span, patch) | ( span. offset ( ) , patch. into ( ) ) )
495
+ . map ( |( span, patch) | ( span. offset ( ) , patch) )
496
496
. collect :: < BTreeMap < usize , String > > ( ) ;
497
497
498
498
let contents = file_path
@@ -516,23 +516,23 @@ impl Run {
516
516
// If newline exists, we write all the contents before newline
517
517
if let Some ( newline_idx) = newline_idx {
518
518
file. write_all ( contents[ last_idx..( last_idx + newline_idx) ] . as_bytes ( ) )
519
- . map_err ( |_| Error :: FileWriteError ( file_path. to_owned ( ) ) ) ?;
519
+ . map_err ( |_| Error :: FileWrite ( file_path. to_owned ( ) ) ) ?;
520
520
file. write_all ( b"\n " )
521
- . map_err ( |_| Error :: FileWriteError ( file_path. to_owned ( ) ) ) ?;
521
+ . map_err ( |_| Error :: FileWrite ( file_path. to_owned ( ) ) ) ?;
522
522
}
523
523
524
524
file. write_all ( b"// @boundaries-ignore " )
525
- . map_err ( |_| Error :: FileWriteError ( file_path. to_owned ( ) ) ) ?;
525
+ . map_err ( |_| Error :: FileWrite ( file_path. to_owned ( ) ) ) ?;
526
526
file. write_all ( reason. as_bytes ( ) )
527
- . map_err ( |_| Error :: FileWriteError ( file_path. to_owned ( ) ) ) ?;
527
+ . map_err ( |_| Error :: FileWrite ( file_path. to_owned ( ) ) ) ?;
528
528
file. write_all ( b"\n " )
529
- . map_err ( |_| Error :: FileWriteError ( file_path. to_owned ( ) ) ) ?;
529
+ . map_err ( |_| Error :: FileWrite ( file_path. to_owned ( ) ) ) ?;
530
530
531
531
last_idx = idx;
532
532
}
533
533
534
534
file. write_all ( contents[ last_idx..] . as_bytes ( ) )
535
- . map_err ( |_| Error :: FileWriteError ( file_path. to_owned ( ) ) ) ?;
535
+ . map_err ( |_| Error :: FileWrite ( file_path. to_owned ( ) ) ) ?;
536
536
537
537
Ok ( ( ) )
538
538
}
0 commit comments