File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -287,10 +287,7 @@ extension_trait! {
287287 where
288288 Self : Sized ,
289289 {
290- Take {
291- stream: self ,
292- remaining: n,
293- }
290+ Take :: new( self , n)
294291 }
295292
296293 #[ doc = r#"
@@ -1454,7 +1451,7 @@ extension_trait! {
14541451 assert_eq!(sum, 6);
14551452
14561453 // if we try to use stream again, it won't work. The following line
1457- // gives " error: use of moved value: `stream`
1454+ // gives error: use of moved value: `stream`
14581455 // assert_eq!(stream.next(), None);
14591456
14601457 // let's try that again
Original file line number Diff line number Diff line change @@ -21,6 +21,15 @@ pin_project! {
2121 }
2222}
2323
24+ impl < S > Take < S > {
25+ pub ( super ) fn new ( stream : S , remaining : usize ) -> Self {
26+ Self {
27+ stream,
28+ remaining,
29+ }
30+ }
31+ }
32+
2433impl < S : Stream > Stream for Take < S > {
2534 type Item = S :: Item ;
2635
You can’t perform that action at this time.
0 commit comments