Skip to content

Commit 6939d67

Browse files
committed
fix code
1 parent f2d6a98 commit 6939d67

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

crates/emmylua_code_analysis/resources/std/string.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function string.dump(func, strip) end
8181
---@param plain? boolean
8282
---@return integer|nil start
8383
---@return integer|nil end
84-
---@return any|nil ... captured
84+
---@return string ... captured
8585
---@nodiscard
8686
function string.find(s, pattern, init, plain) end
8787

crates/emmylua_code_analysis/src/semantic/infer/infer_binary.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ fn infer_union(db: &DbIndex, u: &LuaUnionType, right: &LuaType, op: BinaryOperat
6767
}
6868

6969
match unique_union_types.len() {
70-
0 => Some(LuaType::Unknown),
71-
1 => Some(unique_union_types.into_iter().next().unwrap()),
72-
_ => Some(LuaType::Union(LuaUnionType::new(unique_union_types).into())),
70+
0 => Ok(LuaType::Unknown),
71+
1 => Ok(unique_union_types.into_iter().next().unwrap()),
72+
_ => Ok(LuaType::Union(LuaUnionType::new(unique_union_types).into())),
7373
}
7474
}
7575

@@ -167,8 +167,8 @@ fn infer_binary_expr_add(db: &DbIndex, left: LuaType, right: LuaType) -> InferRe
167167
};
168168
}
169169
match (left.is_nil(), right.is_nil()) {
170-
(true, false) => return Some(right),
171-
(false, true) => return Some(left),
170+
(true, false) => return Ok(right),
171+
(false, true) => return Ok(left),
172172
_ => {}
173173
}
174174

0 commit comments

Comments
 (0)