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! {
287
287
where
288
288
Self : Sized ,
289
289
{
290
- Take {
291
- stream: self ,
292
- remaining: n,
293
- }
290
+ Take :: new( self , n)
294
291
}
295
292
296
293
#[ doc = r#"
@@ -1454,7 +1451,7 @@ extension_trait! {
1454
1451
assert_eq!(sum, 6);
1455
1452
1456
1453
// 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`
1458
1455
// assert_eq!(stream.next(), None);
1459
1456
1460
1457
// let's try that again
Original file line number Diff line number Diff line change @@ -21,6 +21,15 @@ pin_project! {
21
21
}
22
22
}
23
23
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
+
24
33
impl < S : Stream > Stream for Take < S > {
25
34
type Item = S :: Item ;
26
35
You can’t perform that action at this time.
0 commit comments