From 1fea68885cab0e94c6216e6bf06cb0e80abec39f Mon Sep 17 00:00:00 2001 From: Runji Wang Date: Thu, 28 Dec 2023 11:31:49 +0800 Subject: [PATCH] first -> into_first Signed-off-by: Runji Wang --- src/expr/core/src/error.rs | 2 +- src/expr/core/src/expr/wrapper/strict.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/expr/core/src/error.rs b/src/expr/core/src/error.rs index 3e1377893c392..851ba673a8633 100644 --- a/src/expr/core/src/error.rs +++ b/src/expr/core/src/error.rs @@ -148,7 +148,7 @@ pub struct MultiExprError(Box<[ExprError]>); impl MultiExprError { /// Returns the first error. - pub fn first(self) -> ExprError { + pub fn into_first(self) -> ExprError { self.0.into_vec().into_iter().next().expect("first error") } } diff --git a/src/expr/core/src/expr/wrapper/strict.rs b/src/expr/core/src/expr/wrapper/strict.rs index 70392eb61e4cd..5eab4beecd766 100644 --- a/src/expr/core/src/expr/wrapper/strict.rs +++ b/src/expr/core/src/expr/wrapper/strict.rs @@ -57,14 +57,14 @@ where async fn eval(&self, input: &DataChunk) -> Result { match self.inner.eval(input).await { - Err(ExprError::Multiple(_, errors)) => Err(errors.first()), + Err(ExprError::Multiple(_, errors)) => Err(errors.into_first()), res => res, } } async fn eval_v2(&self, input: &DataChunk) -> Result { match self.inner.eval_v2(input).await { - Err(ExprError::Multiple(_, errors)) => Err(errors.first()), + Err(ExprError::Multiple(_, errors)) => Err(errors.into_first()), res => res, } }