mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-10-06 20:02:45 +00:00
No assert, but return when regex haystack is not Str
This commit is contained in:
@@ -95,11 +95,9 @@ impl FnCall for RegexpExtractFnCall {
|
||||
) -> Result<TypedExpr, CompileError> {
|
||||
Self::ARG_COUNT.validate(args)?;
|
||||
let haystack = context.apply_types(&args[0], target_type_set)?;
|
||||
if haystack.return_type == VarType::None {
|
||||
if haystack.return_type != VarType::Str {
|
||||
return Ok(TypedExpr::none());
|
||||
}
|
||||
assert_eq!(haystack.return_type, VarType::Str);
|
||||
|
||||
let UntypedExpr::Literal(Literal::String(pattern)) = &args[1] else {
|
||||
return Err(InvalidFunctionCall::ExpectedLiteral {
|
||||
argument: 2,
|
||||
|
||||
Reference in New Issue
Block a user