@@ -60,50 +60,50 @@ pub fn run_command<W: Write>(
6060 } ;
6161 print_env ( opt, buffer)
6262 }
63- Commands :: Load ( opt) => {
64- match load ( opt ) {
65- Ok ( code ) => if let Some ( exit_code) = code {
63+ Commands :: Load ( opt) => match load ( opt ) {
64+ Ok ( code ) => {
65+ if let Some ( exit_code) = code {
6666 return ExitCode :: from ( exit_code. code ( ) . unwrap_or_default ( ) as u8 ) ;
6767 }
68- Err ( error) => {
69- error ! ( "{}" , error) ;
70- return ExitCode :: FAILURE ;
71- }
7268 }
73- }
74- Commands :: Set ( opt) => {
75- match set ( opt) {
76- Ok ( code) => if let Some ( exit_code) = code {
69+ Err ( error) => {
70+ error ! ( "{}" , error) ;
71+ return ExitCode :: FAILURE ;
72+ }
73+ } ,
74+ Commands :: Set ( opt) => match set ( opt) {
75+ Ok ( code) => {
76+ if let Some ( exit_code) = code {
7777 return ExitCode :: from ( exit_code. code ( ) . unwrap_or_default ( ) as u8 ) ;
7878 }
79- Err ( error) => {
80- error ! ( "{}" , error) ;
81- return ExitCode :: FAILURE ;
82- }
8379 }
84- }
85- Commands :: Add ( opt) => {
86- match add ( opt) {
87- Ok ( code) => if let Some ( exit_code) = code {
80+ Err ( error) => {
81+ error ! ( "{}" , error) ;
82+ return ExitCode :: FAILURE ;
83+ }
84+ } ,
85+ Commands :: Add ( opt) => match add ( opt) {
86+ Ok ( code) => {
87+ if let Some ( exit_code) = code {
8888 return ExitCode :: from ( exit_code. code ( ) . unwrap_or_default ( ) as u8 ) ;
8989 }
90- Err ( error) => {
91- error ! ( "{}" , error) ;
92- return ExitCode :: FAILURE ;
93- }
9490 }
95- }
96- Commands :: Delete ( opt) => {
97- match delete ( opt) {
98- Ok ( code) => if let Some ( exit_code) = code {
91+ Err ( error) => {
92+ error ! ( "{}" , error) ;
93+ return ExitCode :: FAILURE ;
94+ }
95+ } ,
96+ Commands :: Delete ( opt) => match delete ( opt) {
97+ Ok ( code) => {
98+ if let Some ( exit_code) = code {
9999 return ExitCode :: from ( exit_code. code ( ) . unwrap_or_default ( ) as u8 ) ;
100100 }
101- Err ( error) => {
102- error ! ( "{}" , error) ;
103- return ExitCode :: FAILURE ;
104- }
105101 }
106- }
102+ Err ( error) => {
103+ error ! ( "{}" , error) ;
104+ return ExitCode :: FAILURE ;
105+ }
106+ } ,
107107 Commands :: Interactive => {
108108 #[ cfg( not( test) ) ]
109109 let mut terminal = ratatui:: init ( ) ;
@@ -145,7 +145,7 @@ pub fn load(args: &LoadArgs) -> Result<Option<ExitStatus>, ErrorKind> {
145145 } ,
146146 ) ?;
147147 if let Some ( process) = args. process . clone ( ) {
148- return run ( process) . map ( |val| Some ( val ) ) ;
148+ return run ( process) . map ( Some ) ;
149149 }
150150 }
151151 Err ( err) => {
@@ -183,7 +183,7 @@ pub fn set(args: &SetArgs) -> Result<Option<ExitStatus>, ErrorKind> {
183183 variables:: set_variable ( & args. key , & args. value , args. global ) ?;
184184 let process = args. process . clone ( ) ;
185185 if let Some ( process) = process {
186- return run ( process) . map ( |val| Some ( val ) ) ;
186+ return run ( process) . map ( Some ) ;
187187 }
188188 Ok ( None )
189189}
@@ -205,7 +205,7 @@ pub fn add(args: &AddArgs) -> Result<Option<ExitStatus>, ErrorKind> {
205205 ) ?;
206206 let process = args. process . clone ( ) ;
207207 if let Some ( process) = process {
208- return run ( process) . map ( |val| Some ( val ) ) ;
208+ return run ( process) . map ( Some ) ;
209209 }
210210 Ok ( None )
211211}
@@ -224,7 +224,7 @@ pub fn delete(args: &DeleteArgs) -> Result<Option<ExitStatus>, ErrorKind> {
224224 }
225225 }
226226 if let Some ( process) = args. process . clone ( ) {
227- return run ( process) . map ( |val| Some ( val ) ) ;
227+ return run ( process) . map ( Some ) ;
228228 }
229229 Ok ( None )
230230}
@@ -777,7 +777,7 @@ mod tests {
777777 fn test_delete_with_process ( ) {
778778 init ( ) ;
779779 unsafe { env:: set_var ( "TEST_DELETE_PROCESS" , "test_value" ) } ;
780-
780+
781781 #[ cfg( windows) ]
782782 let test_cmd = "echo test" ;
783783 #[ cfg( not( windows) ) ]
0 commit comments