alamb commented on code in PR #7922: URL: https://github.com/apache/arrow-rs/pull/7922#discussion_r2205211356
########## parquet-variant/src/builder.rs: ########## @@ -402,6 +402,11 @@ impl<S: AsRef<str>> FromIterator<S> for MetadataBuilder { impl<S: AsRef<str>> Extend<S> for MetadataBuilder { fn extend<T: IntoIterator<Item = S>>(&mut self, iter: T) { + let iter = iter.into_iter(); + let (min, max) = iter.size_hint(); + + self.field_names.reserve(max.unwrap_or(min)); Review Comment: I think this looks reasonable to me and is consistent with the docs https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.size_hint -- 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...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org