File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1213,6 +1213,13 @@ impl<T> From<Vec<T>> for Rc<[T]> {
1213
1213
}
1214
1214
}
1215
1215
1216
+ #[ stable( feature = "shared_from_iter" , since = "1.37.0" ) ]
1217
+ impl < T > core:: iter:: FromIterator < T > for Rc < [ T ] > {
1218
+ fn from_iter < I : IntoIterator < Item = T > > ( iter : I ) -> Self {
1219
+ iter. into_iter ( ) . collect :: < Vec < T > > ( ) . into ( )
1220
+ }
1221
+ }
1222
+
1216
1223
/// `Weak` is a version of [`Rc`] that holds a non-owning reference to the
1217
1224
/// managed value. The value is accessed by calling [`upgrade`] on the `Weak`
1218
1225
/// pointer, which returns an [`Option`]`<`[`Rc`]`<T>>`.
Original file line number Diff line number Diff line change @@ -1785,6 +1785,13 @@ impl<T> From<Vec<T>> for Arc<[T]> {
1785
1785
}
1786
1786
}
1787
1787
1788
+ #[ stable( feature = "shared_from_iter" , since = "1.37.0" ) ]
1789
+ impl < T > core:: iter:: FromIterator < T > for Arc < [ T ] > {
1790
+ fn from_iter < I : IntoIterator < Item = T > > ( iter : I ) -> Self {
1791
+ iter. into_iter ( ) . collect :: < Vec < T > > ( ) . into ( )
1792
+ }
1793
+ }
1794
+
1788
1795
#[ cfg( test) ]
1789
1796
mod tests {
1790
1797
use std:: boxed:: Box ;
You can’t perform that action at this time.
0 commit comments