File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1270,7 +1270,7 @@ pub struct Owned<I>(I);
1270
1270
impl < I > Iterator for Owned < I >
1271
1271
where
1272
1272
I : StreamingIterator ,
1273
- I :: Item : Sized + ToOwned ,
1273
+ I :: Item : ToOwned ,
1274
1274
{
1275
1275
type Item = <I :: Item as ToOwned >:: Owned ;
1276
1276
@@ -1819,6 +1819,15 @@ mod test {
1819
1819
assert_eq ! ( it. collect:: <Vec <_>>( ) , items) ;
1820
1820
}
1821
1821
1822
+ #[ test]
1823
+ #[ cfg( feature = "std" ) ]
1824
+ fn owned_str ( ) {
1825
+ let s = "The quick brown fox jumps over the lazy dog" ;
1826
+ let words = s. split_whitespace ( ) . map ( str:: to_owned) . collect :: < Vec < _ > > ( ) ;
1827
+ let it = convert_ref ( s. split_whitespace ( ) ) . owned ( ) ;
1828
+ assert_eq ! ( it. collect:: <Vec <_>>( ) , words) ;
1829
+ }
1830
+
1822
1831
#[ test]
1823
1832
fn position ( ) {
1824
1833
let items = [ 0 , 1 ] ;
You can’t perform that action at this time.
0 commit comments