@@ -66,10 +66,7 @@ pub async fn install_and_validate_with_reporter(
6666 let spec = platform_spec ( ) . inspect_err ( |error| {
6767 emit_progress (
6868 reporter,
69- NodeRuntimeProgress :: failed (
70- NodeRuntimeFailureKind :: UnsupportedPlatform ,
71- error. to_string ( ) ,
72- ) ,
69+ NodeRuntimeProgress :: failed ( NodeRuntimeFailureKind :: UnsupportedPlatform , error. to_string ( ) ) ,
7370 ) ;
7471 } ) ?;
7572 let runtime_root = cache:: node_runtime_root ( )
@@ -322,7 +319,10 @@ async fn install_archive(
322319
323320 emit_progress (
324321 reporter,
325- NodeRuntimeProgress :: extracting ( format ! ( "extracting managed Node runtime into {}" , runtime_root. display( ) ) ) ,
322+ NodeRuntimeProgress :: extracting ( format ! (
323+ "extracting managed Node runtime into {}" ,
324+ runtime_root. display( )
325+ ) ) ,
326326 ) ;
327327 match spec. archive_ext {
328328 "tar.gz" => extract_tar_gz ( & archive_path, runtime_root) ?,
@@ -551,10 +551,7 @@ fn reqwest_error(stage: &str, url: &str, error: &reqwest::Error) -> NodeRuntimeE
551551}
552552
553553fn timeout_error ( stage : & str , url : & str , timeout : Duration ) -> NodeRuntimeError {
554- NodeRuntimeError :: managed_invalid ( format ! (
555- "{stage} timed out after {}s for {url}" ,
556- timeout. as_secs( )
557- ) )
554+ NodeRuntimeError :: managed_invalid ( format ! ( "{stage} timed out after {}s for {url}" , timeout. as_secs( ) ) )
558555}
559556
560557fn download_progress_message ( url : & str , downloaded_bytes : u64 , total_bytes : Option < u64 > ) -> String {
@@ -583,7 +580,8 @@ fn classify_error(error: &NodeRuntimeError) -> (NodeRuntimeFailureKind, Option<u
583580 if message. contains ( "unsupported" ) {
584581 return ( NodeRuntimeFailureKind :: UnsupportedPlatform , None ) ;
585582 }
586- if message. contains ( "validate" ) || message. contains ( "executable missing" ) || message. contains ( "entrypoint missing" ) {
583+ if message. contains ( "validate" ) || message. contains ( "executable missing" ) || message. contains ( "entrypoint missing" )
584+ {
587585 return ( NodeRuntimeFailureKind :: ValidationFailed , None ) ;
588586 }
589587 if message. contains ( "download" ) || message. contains ( "extract" ) || message. contains ( "connect failed" ) {
@@ -595,17 +593,11 @@ fn classify_error(error: &NodeRuntimeError) -> (NodeRuntimeFailureKind, Option<u
595593fn parse_http_status ( message : & str ) -> Option < u16 > {
596594 let marker = "http " ;
597595 let start = message. find ( marker) ? + marker. len ( ) ;
598- let digits: String = message[ start..]
599- . chars ( )
600- . take_while ( |ch| ch. is_ascii_digit ( ) )
601- . collect ( ) ;
596+ let digits: String = message[ start..] . chars ( ) . take_while ( |ch| ch. is_ascii_digit ( ) ) . collect ( ) ;
602597 digits. parse :: < u16 > ( ) . ok ( )
603598}
604599
605- fn install_error (
606- error : NodeRuntimeError ,
607- reporter : Option < & dyn NodeRuntimeProgressReporter > ,
608- ) -> NodeRuntimeError {
600+ fn install_error ( error : NodeRuntimeError , reporter : Option < & dyn NodeRuntimeProgressReporter > ) -> NodeRuntimeError {
609601 let ( kind, status_code) = classify_error ( & error) ;
610602 emit_progress (
611603 reporter,
@@ -617,10 +609,7 @@ fn install_error(
617609 error
618610}
619611
620- fn validation_error (
621- error : NodeRuntimeError ,
622- reporter : Option < & dyn NodeRuntimeProgressReporter > ,
623- ) -> NodeRuntimeError {
612+ fn validation_error ( error : NodeRuntimeError , reporter : Option < & dyn NodeRuntimeProgressReporter > ) -> NodeRuntimeError {
624613 emit_progress (
625614 reporter,
626615 NodeRuntimeProgress :: failed ( NodeRuntimeFailureKind :: ValidationFailed , error. to_string ( ) ) ,
0 commit comments