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]> {
12131213 }
12141214}
12151215
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+
12161223/// `Weak` is a version of [`Rc`] that holds a non-owning reference to the
12171224/// managed value. The value is accessed by calling [`upgrade`] on the `Weak`
12181225/// 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]> {
17851785 }
17861786}
17871787
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+
17881795#[ cfg( test) ]
17891796mod tests {
17901797 use std:: boxed:: Box ;
You can’t perform that action at this time.
0 commit comments