Igosuki commented on a change in pull request #910:
URL: https://github.com/apache/arrow-datafusion/pull/910#discussion_r698135614



##########
File path: datafusion/src/logical_plan/expr.rs
##########
@@ -1911,17 +1911,13 @@ mod tests {
     impl ExprRewriter for FooBarRewriter {
         fn mutate(&mut self, expr: Expr) -> Result<Expr> {
             match expr {
-                Expr::Literal(scalar) => {
-                    if let ScalarValue::Utf8(Some(utf8_val)) = scalar {
-                        let utf8_val = if utf8_val == "foo" {
-                            "bar".to_string()
-                        } else {
-                            utf8_val
-                        };
-                        Ok(lit(utf8_val))
+                Expr::Literal(ScalarValue::Utf8(Some(utf8_val))) => {
+                    let utf8_val = if utf8_val == "foo" {

Review comment:
       @Jimexist I get a clippy failure on nightly : 
   ```
   error: unnecessary nested `if let` or `match`
       --> datafusion/src/logical_plan/expr.rs:1915:21
        |
   1915 | /                     if let ScalarValue::Utf8(Some(utf8_val)) = 
scalar {
   1916 | |                         let utf8_val = if utf8_val == "foo" {
   1917 | |                             "bar".to_string()
   1918 | |                         } else {
   ...    |
   1923 | |                         Ok(Expr::Literal(scalar))
   1924 | |                     }
        | |_____________________^
        |
        = note: `-D clippy::collapsible-match` implied by `-D warnings`
   help: the outer pattern can be modified to include the inner pattern
       --> datafusion/src/logical_plan/expr.rs:1914:31
        |
   1914 |                 Expr::Literal(scalar) => {
        |                               ^^^^^^ replace this binding
   1915 |                     if let ScalarValue::Utf8(Some(utf8_val)) = scalar 
{
        |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ with 
this pattern
        = help: for further information visit 
https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match
   
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to