@@ -830,14 +830,14 @@ impl EnvAppData {
830830 // NOTE: we manually set and unset the env vars below rather than using Command::env() to more
831831 // easily handle the case where no command is given
832832
833- apply_removal_of_all_env_vars ( & opts, self . do_debug_printing ) ;
833+ apply_removal_of_all_env_vars ( & opts) ;
834834
835835 // load .env-style config file prior to those given on the command-line
836836 load_config_file ( & mut opts) ?;
837837
838- apply_unset_env_vars ( & opts, self . do_debug_printing ) ?;
838+ apply_unset_env_vars ( & opts) ?;
839839
840- apply_specified_env_vars ( & opts, self . do_debug_printing ) ;
840+ apply_specified_env_vars ( & opts) ;
841841
842842 #[ cfg( all( unix, not( target_os = "fuchsia" ) ) ) ]
843843 {
@@ -990,12 +990,9 @@ impl EnvAppData {
990990 }
991991}
992992
993- fn apply_removal_of_all_env_vars ( opts : & Options < ' _ > , do_debug_printing : bool ) {
993+ fn apply_removal_of_all_env_vars ( opts : & Options < ' _ > ) {
994994 // remove all env vars if told to ignore presets
995995 if opts. ignore_env {
996- if do_debug_printing {
997- let _ = writeln ! ( stderr( ) , "cleaning environ" ) ;
998- }
999996 for ( ref name, _) in env:: vars_os ( ) {
1000997 unsafe {
1001998 env:: remove_var ( name) ;
@@ -1078,13 +1075,7 @@ fn make_options<'a>(
10781075 Ok ( opts)
10791076}
10801077
1081- fn apply_unset_env_vars (
1082- opts : & Options < ' _ > ,
1083- do_debug_printing : bool ,
1084- ) -> Result < ( ) , Box < dyn UError > > {
1085- // -i has already emptied the environment, and GNU does not log the
1086- // individual unsets in that case.
1087- let do_debug_printing = do_debug_printing && !opts. ignore_env ;
1078+ fn apply_unset_env_vars ( opts : & Options < ' _ > ) -> Result < ( ) , Box < dyn UError > > {
10881079 for name in & opts. unsets {
10891080 let native_name = NativeStr :: new ( name) ;
10901081 if name. is_empty ( )
@@ -1096,9 +1087,6 @@ fn apply_unset_env_vars(
10961087 translate ! ( "env-error-cannot-unset-invalid" , "name" => name. quote( ) ) ,
10971088 ) ) ;
10981089 }
1099- if do_debug_printing {
1100- let _ = writeln ! ( stderr( ) , "unset: {}" , name. to_string_lossy( ) ) ;
1101- }
11021090 unsafe {
11031091 env:: remove_var ( name) ;
11041092 }
@@ -1129,7 +1117,7 @@ fn apply_change_directory(opts: &Options<'_>) -> Result<(), Box<dyn UError>> {
11291117 Ok ( ( ) )
11301118}
11311119
1132- fn apply_specified_env_vars ( opts : & Options < ' _ > , do_debug_printing : bool ) {
1120+ fn apply_specified_env_vars ( opts : & Options < ' _ > ) {
11331121 // set specified env vars
11341122 for ( name, val) in & opts. sets {
11351123 /*
@@ -1161,14 +1149,6 @@ fn apply_specified_env_vars(opts: &Options<'_>, do_debug_printing: bool) {
11611149 ) ;
11621150 continue ;
11631151 }
1164- if do_debug_printing {
1165- let _ = writeln ! (
1166- stderr( ) ,
1167- "setenv: {}={}" ,
1168- name. to_string_lossy( ) ,
1169- val. to_string_lossy( )
1170- ) ;
1171- }
11721152 unsafe {
11731153 env:: set_var ( name, val) ;
11741154 }
0 commit comments