eyalleshem commented on code in PR #2073:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2073#discussion_r2499565316


##########
src/tokenizer.rs:
##########
@@ -2176,35 +2206,82 @@ impl<'a> Tokenizer<'a> {
 /// Read from `chars` until `predicate` returns `false` or EOF is hit.
 /// Return the characters read as String, and keep the first non-matching
 /// char available as `chars.next()`.
-fn peeking_take_while(chars: &mut State, mut predicate: impl FnMut(char) -> 
bool) -> String {
-    let mut s = String::new();
+fn peeking_take_while(chars: &mut State, predicate: impl FnMut(char) -> bool) 
-> String {
+    borrow_slice_until(chars, predicate).to_string()
+}
+
+/// Borrow a slice from the original string until `predicate` returns `false` 
or EOF is hit.
+///
+/// # Arguments
+/// * `chars` - The character iterator state (contains reference to original 
source)
+/// * `predicate` - Function that returns true while we should continue taking 
characters
+///
+/// # Returns
+/// A borrowed slice of the source string containing the matched characters

Review Comment:
   done 



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