@@ -44,7 +44,7 @@ use std::path::{Path, PathBuf};
44
44
use std:: process:: { self , ExitStatus } ;
45
45
use std:: { env, fs, str} ;
46
46
47
- use anyhow:: { bail, Context , Error } ;
47
+ use anyhow:: { bail, Context as _ } ;
48
48
use cargo_util:: { exit_status_to_string, is_simple_exit_code, paths, ProcessBuilder } ;
49
49
use log:: { debug, trace, warn} ;
50
50
use rustfix:: diagnostics:: Diagnostic ;
@@ -443,7 +443,7 @@ fn rustfix_crate(
443
443
filename : & Path ,
444
444
args : & FixArgs ,
445
445
config : & Config ,
446
- ) -> Result < FixedCrate , Error > {
446
+ ) -> CargoResult < FixedCrate > {
447
447
if !args. can_run_rustfix ( config) ? {
448
448
// This fix should not be run. Skipping...
449
449
return Ok ( FixedCrate :: default ( ) ) ;
@@ -548,7 +548,7 @@ fn rustfix_and_fix(
548
548
rustc : & ProcessBuilder ,
549
549
filename : & Path ,
550
550
config : & Config ,
551
- ) -> Result < ( ) , Error > {
551
+ ) -> CargoResult < ( ) > {
552
552
// If not empty, filter by these lints.
553
553
// TODO: implement a way to specify this.
554
554
let only = HashSet :: new ( ) ;
@@ -695,7 +695,7 @@ fn exit_with(status: ExitStatus) -> ! {
695
695
process:: exit ( status. code ( ) . unwrap_or ( 3 ) ) ;
696
696
}
697
697
698
- fn log_failed_fix ( stderr : & [ u8 ] , status : ExitStatus ) -> Result < ( ) , Error > {
698
+ fn log_failed_fix ( stderr : & [ u8 ] , status : ExitStatus ) -> CargoResult < ( ) > {
699
699
let stderr = str:: from_utf8 ( stderr) . context ( "failed to parse rustc stderr as utf-8" ) ?;
700
700
701
701
let diagnostics = stderr
@@ -776,12 +776,12 @@ struct FixArgs {
776
776
}
777
777
778
778
impl FixArgs {
779
- fn get ( ) -> Result < FixArgs , Error > {
779
+ fn get ( ) -> CargoResult < FixArgs > {
780
780
Self :: from_args ( env:: args_os ( ) )
781
781
}
782
782
783
783
// This is a separate function so that we can use it in tests.
784
- fn from_args ( argv : impl IntoIterator < Item = OsString > ) -> Result < Self , Error > {
784
+ fn from_args ( argv : impl IntoIterator < Item = OsString > ) -> CargoResult < Self > {
785
785
let mut argv = argv. into_iter ( ) ;
786
786
let mut rustc = argv
787
787
. nth ( 1 )
@@ -792,7 +792,7 @@ impl FixArgs {
792
792
let mut other = Vec :: new ( ) ;
793
793
let mut format_args = Vec :: new ( ) ;
794
794
795
- let mut handle_arg = |arg : OsString | -> Result < ( ) , Error > {
795
+ let mut handle_arg = |arg : OsString | -> CargoResult < ( ) > {
796
796
let path = PathBuf :: from ( arg) ;
797
797
if path. extension ( ) . and_then ( |s| s. to_str ( ) ) == Some ( "rs" ) && path. exists ( ) {
798
798
file = Some ( path) ;
0 commit comments