iffyio commented on code in PR #1851:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1851#discussion_r2088311461


##########
src/display_utils.rs:
##########
@@ -71,12 +68,17 @@ impl Display for SpaceOrNewline {
 
 /// A value that displays a comma-separated list of values.
 /// When pretty-printed (using {:#}), it displays each value on a new line.
-pub struct DisplayCommaSeparated<'a, T: fmt::Display>(&'a [T]);
+pub(crate) struct DisplayCommaSeparated<I, T: fmt::Display>(I)
+where
+    I: IntoIterator<Item = T> + Clone;
 
-impl<T: fmt::Display> fmt::Display for DisplayCommaSeparated<'_, T> {
+impl<I, T: fmt::Display> fmt::Display for DisplayCommaSeparated<I, T>
+where
+    I: IntoIterator<Item = T> + Clone,
+{
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         let mut first = true;
-        for t in self.0 {
+        for t in self.0.clone() {

Review Comment:
   was the clone needed here, we seem to only call `fmt` on `t`?



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to