@@ -338,6 +338,7 @@ pub struct FileUpdater {
338
338
dst_buf : String ,
339
339
}
340
340
impl FileUpdater {
341
+ #[ track_caller]
341
342
fn update_file_checked_inner (
342
343
& mut self ,
343
344
tool : & str ,
@@ -361,6 +362,7 @@ impl FileUpdater {
361
362
}
362
363
}
363
364
365
+ #[ track_caller]
364
366
fn update_file_inner ( & mut self , path : & Path , update : & mut dyn FnMut ( & Path , & str , & mut String ) -> UpdateStatus ) {
365
367
let mut file = File :: open ( path, OpenOptions :: new ( ) . read ( true ) . write ( true ) ) ;
366
368
file. read_to_cleared_string ( & mut self . src_buf ) ;
@@ -370,6 +372,7 @@ impl FileUpdater {
370
372
}
371
373
}
372
374
375
+ #[ track_caller]
373
376
pub fn update_file_checked (
374
377
& mut self ,
375
378
tool : & str ,
@@ -380,6 +383,7 @@ impl FileUpdater {
380
383
self . update_file_checked_inner ( tool, mode, path. as_ref ( ) , update) ;
381
384
}
382
385
386
+ #[ track_caller]
383
387
pub fn update_file (
384
388
& mut self ,
385
389
path : impl AsRef < Path > ,
@@ -598,6 +602,7 @@ impl<'txt> RustSearcher<'txt> {
598
602
}
599
603
}
600
604
605
+ #[ track_caller]
601
606
#[ expect( clippy:: must_use_candidate) ]
602
607
pub fn try_rename_file ( old_name : & Path , new_name : & Path ) -> bool {
603
608
match OpenOptions :: new ( ) . create_new ( true ) . write ( true ) . open ( new_name) {
@@ -620,6 +625,7 @@ pub fn try_rename_file(old_name: &Path, new_name: &Path) -> bool {
620
625
}
621
626
}
622
627
628
+ #[ track_caller]
623
629
#[ expect( clippy:: must_use_candidate) ]
624
630
pub fn try_rename_dir ( old_name : & Path , new_name : & Path ) -> bool {
625
631
match fs:: create_dir ( new_name) {
@@ -646,10 +652,12 @@ pub fn try_rename_dir(old_name: &Path, new_name: &Path) -> bool {
646
652
}
647
653
}
648
654
655
+ #[ track_caller]
649
656
pub fn write_file ( path : & Path , contents : & str ) {
650
657
expect_action ( fs:: write ( path, contents) , ErrAction :: Write , path) ;
651
658
}
652
659
660
+ #[ track_caller]
653
661
pub fn run_exit_on_err ( path : & ( impl AsRef < Path > + ?Sized ) , cmd : & mut Command ) {
654
662
match expect_action ( cmd. status ( ) , ErrAction :: Run , path. as_ref ( ) ) . code ( ) {
655
663
Some ( 0 ) => { } ,
@@ -661,6 +669,7 @@ pub fn run_exit_on_err(path: &(impl AsRef<Path> + ?Sized), cmd: &mut Command) {
661
669
}
662
670
}
663
671
672
+ #[ track_caller]
664
673
#[ must_use]
665
674
pub fn run_with_output ( path : & ( impl AsRef < Path > + ?Sized ) , cmd : & mut Command ) -> Vec < u8 > {
666
675
fn f ( path : & Path , cmd : & mut Command ) -> Vec < u8 > {
@@ -746,6 +755,7 @@ pub fn split_args_for_threads(
746
755
}
747
756
}
748
757
758
+ #[ track_caller]
749
759
#[ expect( clippy:: must_use_candidate) ]
750
760
pub fn delete_file_if_exists ( path : & Path ) -> bool {
751
761
match fs:: remove_file ( path) {
@@ -755,6 +765,7 @@ pub fn delete_file_if_exists(path: &Path) -> bool {
755
765
}
756
766
}
757
767
768
+ #[ track_caller]
758
769
pub fn delete_dir_if_exists ( path : & Path ) {
759
770
match fs:: remove_dir_all ( path) {
760
771
Ok ( ( ) ) => { } ,
0 commit comments