From 830794cd7d733059b2efef3087009a594142eddd Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Thu, 22 Aug 2024 14:57:13 +0800 Subject: [PATCH] fix clippy Signed-off-by: Richard Chien --- src/frontend/src/binder/expr/function/aggregate.rs | 6 +++--- src/frontend/src/binder/expr/function/mod.rs | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/frontend/src/binder/expr/function/aggregate.rs b/src/frontend/src/binder/expr/function/aggregate.rs index efb450465bad..a9067205f77b 100644 --- a/src/frontend/src/binder/expr/function/aggregate.rs +++ b/src/frontend/src/binder/expr/function/aggregate.rs @@ -140,7 +140,7 @@ impl Binder { match (kind, direct_args.len(), args.as_mut_slice()) { (AggKind::Builtin(PbAggKind::PercentileCont | PbAggKind::PercentileDisc), 1, [arg]) => { let fraction = &mut direct_args[0]; - decimal_to_float64(fraction, &kind)?; + decimal_to_float64(fraction, kind)?; if matches!(&kind, AggKind::Builtin(PbAggKind::PercentileCont)) { arg.cast_implicit_mut(DataType::Float64).map_err(|_| { ErrorCode::InvalidInputSyntax(format!( @@ -153,11 +153,11 @@ impl Binder { (AggKind::Builtin(PbAggKind::Mode), 0, [_arg]) => {} (AggKind::Builtin(PbAggKind::ApproxPercentile), 1..=2, [_percentile_col]) => { let percentile = &mut direct_args[0]; - decimal_to_float64(percentile, &kind)?; + decimal_to_float64(percentile, kind)?; match direct_args.len() { 2 => { let relative_error = &mut direct_args[1]; - decimal_to_float64(relative_error, &kind)?; + decimal_to_float64(relative_error, kind)?; } 1 => { let relative_error: ExprImpl = Literal::new( diff --git a/src/frontend/src/binder/expr/function/mod.rs b/src/frontend/src/binder/expr/function/mod.rs index 4d5c11067ca8..2793ee54b85d 100644 --- a/src/frontend/src/binder/expr/function/mod.rs +++ b/src/frontend/src/binder/expr/function/mod.rs @@ -68,7 +68,6 @@ macro_rules! reject_syntax { } }; } -pub(self) use reject_syntax; impl Binder { pub(in crate::binder) fn bind_function( @@ -537,12 +536,12 @@ impl Binder { return bind_result; } - return Err(ErrorCode::InvalidInputSyntax( + Err(ErrorCode::InvalidInputSyntax( "failed to parse the input query and extract the udf expression, please recheck the syntax" .to_string(), ) - .into()); + .into()) } pub(in crate::binder) fn bind_function_expr_arg(