File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ pub struct WriteFmtFuture<'a, T: Unpin + ?Sized> {
1111 pub ( crate ) writer : & ' a mut T ,
1212 pub ( crate ) res : Option < io:: Result < Vec < u8 > > > ,
1313 pub ( crate ) buffer : Option < Vec < u8 > > ,
14- pub ( crate ) amt : u64 ,
14+ pub ( crate ) amt : usize ,
1515}
1616
1717impl < T : Write + Unpin + ?Sized > Future for WriteFmtFuture < ' _ , T > {
@@ -37,15 +37,15 @@ impl<T: Write + Unpin + ?Sized> Future for WriteFmtFuture<'_, T> {
3737
3838 // Copy the data from the buffer into the writer until it's done.
3939 loop {
40- if * amt == buffer. len ( ) as u64 {
40+ if * amt == buffer. len ( ) {
4141 futures_core:: ready!( Pin :: new( & mut * * writer) . poll_flush( cx) ) ?;
4242 return Poll :: Ready ( Ok ( ( ) ) ) ;
4343 }
44- let i = futures_core:: ready!( Pin :: new( & mut * * writer) . poll_write( cx, buffer) ) ?;
44+ let i = futures_core:: ready!( Pin :: new( & mut * * writer) . poll_write( cx, & buffer[ * amt.. ] ) ) ?;
4545 if i == 0 {
4646 return Poll :: Ready ( Err ( io:: ErrorKind :: WriteZero . into ( ) ) ) ;
4747 }
48- * amt += i as u64 ;
48+ * amt += i;
4949 }
5050 }
5151}
You can’t perform that action at this time.
0 commit comments