Skip to content

Commit 3b92779

Browse files
committed
fmt
1 parent 918a911 commit 3b92779

File tree

4 files changed

+32
-11
lines changed

4 files changed

+32
-11
lines changed

crates/emmylua_code_analysis/src/semantic/type_check/complex_type/mod.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use object_type_check::check_object_type_compact;
1010
use table_generic_check::check_table_generic_type_compact;
1111
use tuple_type_check::check_tuple_type_compact;
1212

13-
use crate::{semantic::type_check::type_check_context::TypeCheckContext, LuaType, LuaUnionType};
13+
use crate::{LuaType, LuaUnionType, semantic::type_check::type_check_context::TypeCheckContext};
1414

1515
use super::{
1616
TypeCheckResult, check_general_type_compact, type_check_fail_reason::TypeCheckFailReason,
@@ -115,7 +115,12 @@ pub fn check_complex_type_compact(
115115
// Do I need to check union types?
116116
if let LuaType::Union(union) = compact_type {
117117
for sub_compact in union.into_vec() {
118-
match check_complex_type_compact(context, source, &sub_compact, check_guard.next_level()?) {
118+
match check_complex_type_compact(
119+
context,
120+
source,
121+
&sub_compact,
122+
check_guard.next_level()?,
123+
) {
119124
Ok(_) => {}
120125
Err(e) => return Err(e),
121126
}
@@ -136,7 +141,12 @@ fn check_union_type_compact_union(
136141
) -> TypeCheckResult {
137142
let compact_types = compact_union.into_vec();
138143
for compact_sub_type in compact_types {
139-
check_general_type_compact(context, source, &compact_sub_type, check_guard.next_level()?)?;
144+
check_general_type_compact(
145+
context,
146+
source,
147+
&compact_sub_type,
148+
check_guard.next_level()?,
149+
)?;
140150
}
141151

142152
Ok(())

crates/emmylua_code_analysis/src/semantic/type_check/complex_type/object_type_check.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ fn check_object_type_compact_member_owner(
122122
}
123123
};
124124

125-
match check_general_type_compact(context, source_type, &member_type, check_guard.next_level()?) {
125+
match check_general_type_compact(
126+
context,
127+
source_type,
128+
&member_type,
129+
check_guard.next_level()?,
130+
) {
126131
Ok(_) => {}
127132
Err(TypeCheckFailReason::TypeNotMatch) => {
128133
return Err(TypeCheckFailReason::TypeNotMatchWithReason(

crates/emmylua_code_analysis/src/semantic/type_check/mod.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ fn check_general_type_compact(
5454
}
5555

5656
if let Some(origin_type) = escape_type(&context.db, compact_type) {
57-
return check_general_type_compact(context, source, &origin_type, check_guard.next_level()?);
57+
return check_general_type_compact(
58+
context,
59+
source,
60+
&origin_type,
61+
check_guard.next_level()?,
62+
);
5863
}
5964

6065
match source {
@@ -84,7 +89,9 @@ fn check_general_type_compact(
8489
| LuaType::ConstTplRef(_)
8590
| LuaType::Namespace(_)
8691
| LuaType::Variadic(_)
87-
| LuaType::Language(_) => check_simple_type_compact(context, source, compact_type, check_guard),
92+
| LuaType::Language(_) => {
93+
check_simple_type_compact(context, source, compact_type, check_guard)
94+
}
8895

8996
// type ref
9097
LuaType::Ref(type_decl_id) => {
@@ -101,7 +108,9 @@ fn check_general_type_compact(
101108
check_doc_func_type_compact(context, doc_func, compact_type, check_guard)
102109
}
103110
// signature type
104-
LuaType::Signature(sig_id) => check_sig_type_compact(context, sig_id, compact_type, check_guard),
111+
LuaType::Signature(sig_id) => {
112+
check_sig_type_compact(context, sig_id, compact_type, check_guard)
113+
}
105114

106115
// complex type
107116
LuaType::Array(_)

crates/emmylua_code_analysis/src/semantic/type_check/type_check_context.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ pub struct TypeCheckContext<'db> {
88

99
impl<'db> TypeCheckContext<'db> {
1010
pub fn new(db: &'db DbIndex, detail: bool) -> Self {
11-
Self {
12-
detail,
13-
db,
14-
}
11+
Self { detail, db }
1512
}
1613
}

0 commit comments

Comments
 (0)