andygrove opened a new pull request, #2173: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2173
## Summary Remove an unnecessary `String::clone()` in `maybe_concat_string_literal()`. ## Changes ```rust // Before: str.push_str(s.clone().as_str()); // After: str.push_str(s); ``` Since `s` is already a `&String` (from the `ref s` pattern match), it can be passed directly to `push_str()` which accepts `&str`. The deref coercion handles the conversion automatically. ## Impact This removes one heap allocation per concatenated string literal when parsing SQL with adjacent string literals like: ```sql SELECT 'foo' 'bar' -- Concatenates to 'foobar' ``` Small change but in the spirit of avoiding unnecessary allocations in the parser hot path. ## Test plan - [x] All existing tests pass - [x] `cargo clippy` passes 🤖 Generated with [Claude Code](https://claude.ai/code) -- 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]
