1+ use std:: io;
12use std:: mem;
23use std:: pin:: Pin ;
34use std:: str;
45
56use pin_project_lite:: pin_project;
67
7- use async_std :: io :: { self , BufRead } ;
8- use async_std :: stream :: Stream ;
9- use async_std :: task:: { ready , Context , Poll } ;
8+ use futures_lite :: prelude :: * ;
9+ use futures_lite :: ready ;
10+ use std :: task:: { Context , Poll } ;
1011
1112pin_project ! {
1213 /// A stream of lines in a byte stream.
@@ -31,7 +32,7 @@ pin_project! {
3132impl < R > Lines < R > {
3233 pub ( crate ) fn new ( reader : R ) -> Lines < R >
3334 where
34- R : BufRead + Unpin + Sized ,
35+ R : AsyncBufRead + Unpin + Sized ,
3536 {
3637 Lines {
3738 reader,
@@ -42,12 +43,12 @@ impl<R> Lines<R> {
4243 }
4344}
4445
45- impl < R : BufRead > Stream for Lines < R > {
46+ impl < R : AsyncBufRead > Stream for Lines < R > {
4647 type Item = io:: Result < String > ;
4748
4849 fn poll_next ( self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < Option < Self :: Item > > {
4950 let this = self . project ( ) ;
50- let n = async_std :: task :: ready!( read_line_internal(
51+ let n = ready ! ( read_line_internal(
5152 this. reader,
5253 cx,
5354 this. buf,
@@ -67,7 +68,7 @@ impl<R: BufRead> Stream for Lines<R> {
6768 }
6869}
6970
70- fn read_line_internal < R : BufRead + ?Sized > (
71+ fn read_line_internal < R : AsyncBufRead + ?Sized > (
7172 reader : Pin < & mut R > ,
7273 cx : & mut Context < ' _ > ,
7374 buf : & mut String ,
@@ -91,7 +92,7 @@ fn read_line_internal<R: BufRead + ?Sized>(
9192 }
9293}
9394
94- fn read_until_internal < R : BufRead + ?Sized > (
95+ fn read_until_internal < R : AsyncBufRead + ?Sized > (
9596 mut reader : Pin < & mut R > ,
9697 cx : & mut Context < ' _ > ,
9798 buf : & mut Vec < u8 > ,
0 commit comments