tustvold commented on code in PR #4405:
URL: https://github.com/apache/arrow-rs/pull/4405#discussion_r1227954866
##########
arrow-buffer/src/buffer/scalar.rs:
##########
@@ -140,6 +140,12 @@ impl<T: ArrowNativeType> From<Vec<T>> for ScalarBuffer<T> {
}
}
+impl<T: ArrowNativeType> FromIterator<T> for ScalarBuffer<T> {
+ fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self {
+ iter.into_iter().collect::<Vec<_>>().into()
Review Comment:
An important thing to note is that `Vec: FromIterator` has a specialization
for `TrustedLen` iterators, such as those from slices. This allows us to not
need `Buffer::try_from_trusted_len_iter`
--
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]