@@ -452,13 +452,8 @@ fn load_policy(
452452 policy : & str ,
453453 remote_extends : & remote_extends:: RemoteExtendsConfig ,
454454) -> anyhow:: Result < LoadedPolicy > {
455- let loaded = policy_diff:: load_policy_from_arg ( policy, true , remote_extends) . map_err ( |e| {
456- anyhow:: anyhow!(
457- "Failed to load policy {}: {}" ,
458- e. source,
459- e. message
460- )
461- } ) ?;
455+ let loaded = policy_diff:: load_policy_from_arg ( policy, true , remote_extends)
456+ . map_err ( |e| anyhow:: anyhow!( "Failed to load policy {}: {}" , e. source, e. message) ) ?;
462457
463458 Ok ( loaded)
464459}
@@ -475,8 +470,7 @@ fn load_or_create_signer(path: &Path, stderr: &mut dyn Write) -> anyhow::Result<
475470 let pub_path = PathBuf :: from ( format ! ( "{}.pub" , path. display( ) ) ) ;
476471 let pub_hex = std:: fs:: read_to_string ( & pub_path)
477472 . with_context ( || format ! ( "read public key {}" , pub_path. display( ) ) ) ?;
478- let public_key =
479- PublicKey :: from_hex ( pub_hex. trim ( ) ) . context ( "parse public key hex" ) ?;
473+ let public_key = PublicKey :: from_hex ( pub_hex. trim ( ) ) . context ( "parse public key hex" ) ?;
480474 return Ok ( Box :: new ( hush_core:: TpmSealedSeedSigner :: new (
481475 public_key, blob,
482476 ) ) ) ;
@@ -515,9 +509,13 @@ fn load_or_create_signer(path: &Path, stderr: &mut dyn Write) -> anyhow::Result<
515509#[ derive( Clone , Debug ) ]
516510enum SandboxWrapper {
517511 None ,
518- SandboxExec { profile_path : PathBuf } ,
512+ SandboxExec {
513+ profile_path : PathBuf ,
514+ } ,
519515 #[ cfg( target_os = "linux" ) ]
520- Bwrap { args : Vec < String > } ,
516+ Bwrap {
517+ args : Vec < String > ,
518+ } ,
521519}
522520
523521fn maybe_prepare_sandbox (
@@ -693,8 +691,8 @@ async fn start_connect_proxy(
693691 let outcome = outcome. clone ( ) ;
694692
695693 tokio:: spawn ( async move {
696- let _ = handle_connect_proxy_client ( socket , engine , context , event_tx , outcome )
697- . await ;
694+ let _ =
695+ handle_connect_proxy_client ( socket , engine , context , event_tx , outcome ) . await ;
698696 } ) ;
699697 }
700698 } ) ;
@@ -713,8 +711,7 @@ async fn handle_connect_proxy_client(
713711 . await
714712 . context ( "read proxy request header" ) ?;
715713
716- let header_str =
717- std:: str:: from_utf8 ( & header) . context ( "proxy request header must be UTF-8" ) ?;
714+ let header_str = std:: str:: from_utf8 ( & header) . context ( "proxy request header must be UTF-8" ) ?;
718715 let mut lines = header_str. split ( "\r \n " ) ;
719716 let request_line = lines
720717 . next ( )
@@ -772,9 +769,7 @@ async fn handle_connect_proxy_client(
772769 if !result. allowed {
773770 // If we already sent 200 (IP + SNI path), we can only close the tunnel.
774771 if sni_buf. is_empty ( ) {
775- client
776- . write_all ( b"HTTP/1.1 403 Forbidden\r \n \r \n " )
777- . await ?;
772+ client. write_all ( b"HTTP/1.1 403 Forbidden\r \n \r \n " ) . await ?;
778773 }
779774 return Ok ( ( ) ) ;
780775 }
0 commit comments