@@ -6,8 +6,7 @@ use crate::utils::{arg, file};
6
6
use crate :: { file_check, utils, ShellCore } ;
7
7
8
8
fn type_no_opt_sub ( core : & mut ShellCore , com : & String ) -> i32 {
9
- if core. shopts . query ( "expand_aliases" )
10
- && core. db . has_array_value ( "BASH_ALIASES" , com) {
9
+ if core. shopts . query ( "expand_aliases" ) && core. db . has_array_value ( "BASH_ALIASES" , com) {
11
10
let alias = core. db . get_elem ( "BASH_ALIASES" , com) . unwrap ( ) ;
12
11
println ! ( "{} is aliased to `{}'" , & com, & alias) ;
13
12
return 0 ;
@@ -37,7 +36,7 @@ fn type_no_opt_sub(core: &mut ShellCore, com: &String) -> i32 {
37
36
}
38
37
39
38
let s = format ! ( "{}: not found" , & com) ;
40
- return super :: error_exit ( 1 , "type" , & s, core) ;
39
+ super :: error_exit ( 1 , "type" , & s, core)
41
40
}
42
41
43
42
fn type_no_opt ( core : & mut ShellCore , args : & [ String ] ) -> i32 {
@@ -63,8 +62,7 @@ fn type_t(core: &mut ShellCore, args: &[String]) -> i32 {
63
62
}
64
63
65
64
fn type_t_sub ( core : & mut ShellCore , com : & String ) -> i32 {
66
- if core. shopts . query ( "expand_aliases" )
67
- && core. db . has_array_value ( "BASH_ALIASES" , com) {
65
+ if core. shopts . query ( "expand_aliases" ) && core. db . has_array_value ( "BASH_ALIASES" , com) {
68
66
println ! ( "alias" ) ;
69
67
return 0 ;
70
68
}
@@ -119,8 +117,8 @@ fn type_p_sub(core: &mut ShellCore, com: &String) -> i32 {
119
117
return 0 ;
120
118
}
121
119
122
- if let Ok ( path) = core. db . get_elem ( "BASH_CMDS" , & com) {
123
- if ! path. is_empty ( ) {
120
+ if let Ok ( path) = core. db . get_elem ( "BASH_CMDS" , com) {
121
+ if !path. is_empty ( ) {
124
122
println ! ( "{}" , & path) ;
125
123
return 0 ;
126
124
}
@@ -155,7 +153,7 @@ fn type_large_p_sub(core: &mut ShellCore, com: &String) -> i32 {
155
153
println ! ( "{com}" ) ;
156
154
return 0 ;
157
155
}
158
-
156
+
159
157
es
160
158
}
161
159
0 commit comments