File tree 1 file changed +4
-4
lines changed 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> {
11
11
pub ( crate ) writer : & ' a mut T ,
12
12
pub ( crate ) res : Option < io:: Result < Vec < u8 > > > ,
13
13
pub ( crate ) buffer : Option < Vec < u8 > > ,
14
- pub ( crate ) amt : u64 ,
14
+ pub ( crate ) amt : usize ,
15
15
}
16
16
17
17
impl < T : Write + Unpin + ?Sized > Future for WriteFmtFuture < ' _ , T > {
@@ -37,15 +37,15 @@ impl<T: Write + Unpin + ?Sized> Future for WriteFmtFuture<'_, T> {
37
37
38
38
// Copy the data from the buffer into the writer until it's done.
39
39
loop {
40
- if * amt == buffer. len ( ) as u64 {
40
+ if * amt == buffer. len ( ) {
41
41
futures_core:: ready!( Pin :: new( & mut * * writer) . poll_flush( cx) ) ?;
42
42
return Poll :: Ready ( Ok ( ( ) ) ) ;
43
43
}
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.. ] ) ) ?;
45
45
if i == 0 {
46
46
return Poll :: Ready ( Err ( io:: ErrorKind :: WriteZero . into ( ) ) ) ;
47
47
}
48
- * amt += i as u64 ;
48
+ * amt += i;
49
49
}
50
50
}
51
51
}
You can’t perform that action at this time.
0 commit comments