rluvaton commented on code in PR #23430:
URL: https://github.com/apache/datafusion/pull/23430#discussion_r3554649095


##########
datafusion/functions/src/string/split_part.rs:
##########
@@ -407,9 +407,9 @@ fn split_nth_finder<'a>(
     let bytes = string.as_bytes();
     let mut start = 0;
     for _ in 0..n {
-        match finder.find(&bytes[start..]) {
-            Some(pos) => start += pos + delim_len,
-            None => return None,
+        {
+            let pos = finder.find(&bytes[start..])?;
+            start += pos + delim_len
         }

Review Comment:
   Nit: no need for the double closure 



##########
datafusion/functions/src/string/split_part.rs:
##########
@@ -430,9 +430,9 @@ fn rsplit_nth_finder<'a>(
     let bytes = string.as_bytes();
     let mut end = bytes.len();
     for _ in 0..n {
-        match finder.rfind(&bytes[..end]) {
-            Some(pos) => end = pos,
-            None => return None,
+        {
+            let pos = finder.rfind(&bytes[..end])?;
+            end = pos
         }

Review Comment:
   Nit: no need for the double closure 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to