@@ -9,55 +9,55 @@ pub fn remove_type(db: &DbIndex, source: LuaType, removed_type: LuaType) -> Opti
9
9
}
10
10
}
11
11
12
- let source = get_real_type ( db, & source) . unwrap_or ( & source) ;
12
+ let real_type = get_real_type ( db, & source) . unwrap_or ( & source) ;
13
13
14
14
match & removed_type {
15
15
LuaType :: Nil => {
16
- if source . is_nil ( ) {
16
+ if real_type . is_nil ( ) {
17
17
return None ;
18
18
}
19
19
}
20
20
LuaType :: Boolean => {
21
- if source . is_boolean ( ) {
21
+ if real_type . is_boolean ( ) {
22
22
return None ;
23
23
}
24
24
}
25
25
LuaType :: Integer => {
26
- if source . is_integer ( ) {
26
+ if real_type . is_integer ( ) {
27
27
return None ;
28
28
}
29
29
}
30
30
LuaType :: Number => {
31
- if source . is_number ( ) {
31
+ if real_type . is_number ( ) {
32
32
return None ;
33
33
}
34
34
}
35
35
LuaType :: String => {
36
- if source . is_string ( ) {
36
+ if real_type . is_string ( ) {
37
37
return None ;
38
38
}
39
39
}
40
40
LuaType :: Io => {
41
- if source . is_io ( ) {
41
+ if real_type . is_io ( ) {
42
42
return None ;
43
43
}
44
44
}
45
45
LuaType :: Function => {
46
- if source . is_function ( ) {
46
+ if real_type . is_function ( ) {
47
47
return None ;
48
48
}
49
49
}
50
50
LuaType :: Thread => {
51
- if source . is_thread ( ) {
51
+ if real_type . is_thread ( ) {
52
52
return None ;
53
53
}
54
54
}
55
55
LuaType :: Userdata => {
56
- if source . is_userdata ( ) {
56
+ if real_type . is_userdata ( ) {
57
57
return None ;
58
58
}
59
59
}
60
- LuaType :: Table => match & source {
60
+ LuaType :: Table => match & real_type {
61
61
LuaType :: TableConst ( _)
62
62
| LuaType :: Table
63
63
| LuaType :: Userdata
@@ -74,7 +74,7 @@ pub fn remove_type(db: &DbIndex, source: LuaType, removed_type: LuaType) -> Opti
74
74
return Some ( source. clone ( ) ) ;
75
75
}
76
76
if type_decl. is_alias ( ) {
77
- if let Some ( alias_ref) = get_real_type ( db, & source ) {
77
+ if let Some ( alias_ref) = get_real_type ( db, & real_type ) {
78
78
return remove_type ( db, alias_ref. clone ( ) , removed_type) ;
79
79
}
80
80
}
@@ -91,7 +91,7 @@ pub fn remove_type(db: &DbIndex, source: LuaType, removed_type: LuaType) -> Opti
91
91
}
92
92
_ => { }
93
93
} ,
94
- LuaType :: DocStringConst ( s) | LuaType :: StringConst ( s) => match & source {
94
+ LuaType :: DocStringConst ( s) | LuaType :: StringConst ( s) => match & real_type {
95
95
LuaType :: DocStringConst ( s2) => {
96
96
if s == s2 {
97
97
return None ;
@@ -104,7 +104,7 @@ pub fn remove_type(db: &DbIndex, source: LuaType, removed_type: LuaType) -> Opti
104
104
}
105
105
_ => { }
106
106
} ,
107
- LuaType :: DocIntegerConst ( i) | LuaType :: IntegerConst ( i) => match & source {
107
+ LuaType :: DocIntegerConst ( i) | LuaType :: IntegerConst ( i) => match & real_type {
108
108
LuaType :: DocIntegerConst ( i2) => {
109
109
if i == i2 {
110
110
return None ;
@@ -117,7 +117,7 @@ pub fn remove_type(db: &DbIndex, source: LuaType, removed_type: LuaType) -> Opti
117
117
}
118
118
_ => { }
119
119
} ,
120
- LuaType :: DocBooleanConst ( b) | LuaType :: BooleanConst ( b) => match & source {
120
+ LuaType :: DocBooleanConst ( b) | LuaType :: BooleanConst ( b) => match & real_type {
121
121
LuaType :: DocBooleanConst ( b2) => {
122
122
if b == b2 {
123
123
return None ;
@@ -133,7 +133,7 @@ pub fn remove_type(db: &DbIndex, source: LuaType, removed_type: LuaType) -> Opti
133
133
_ => { }
134
134
}
135
135
136
- if let LuaType :: Union ( u) = & source {
136
+ if let LuaType :: Union ( u) = & real_type {
137
137
let types = u
138
138
. into_vec ( )
139
139
. iter ( )
@@ -144,7 +144,7 @@ pub fn remove_type(db: &DbIndex, source: LuaType, removed_type: LuaType) -> Opti
144
144
let types = u
145
145
. into_vec ( )
146
146
. iter ( )
147
- . filter_map ( |t| remove_type ( db, source . clone ( ) , t. clone ( ) ) )
147
+ . filter_map ( |t| remove_type ( db, real_type . clone ( ) , t. clone ( ) ) )
148
148
. collect :: < Vec < _ > > ( ) ;
149
149
return Some ( LuaType :: from_vec ( types) ) ;
150
150
}
0 commit comments