@@ -332,9 +332,9 @@ impl<W: tokio::io::AsyncWrite + Unpin> tokio::io::AsyncWrite for ProgressBarIter
332332 ) -> Poll < io:: Result < usize > > {
333333 Pin :: new ( & mut self . it ) . poll_write ( cx, buf) . map ( |poll| {
334334 poll. map ( |inc| {
335- let oldprog = self . progress . position ( ) ;
336- let newprog = self . seek_max . update_seq ( oldprog , inc. try_into ( ) . unwrap ( ) ) ;
337- self . progress . set_position ( newprog ) ;
335+ let pos = self . progress . position ( ) ;
336+ let new = self . seek_max . update_seq ( pos , inc as u64 ) ;
337+ self . progress . set_position ( new ) ;
338338 inc
339339 } )
340340 } )
@@ -361,9 +361,9 @@ impl<W: tokio::io::AsyncRead + Unpin> tokio::io::AsyncRead for ProgressBarIter<W
361361 let poll = Pin :: new ( & mut self . it ) . poll_read ( cx, buf) ;
362362 if let Poll :: Ready ( _e) = & poll {
363363 let inc = buf. filled ( ) . len ( ) as u64 - prev_len;
364- let oldprog = self . progress . position ( ) ;
365- let newprog = self . seek_max . update_seq ( oldprog , inc) ;
366- self . progress . set_position ( newprog ) ;
364+ let pos = self . progress . position ( ) ;
365+ let new = self . seek_max . update_seq ( pos , inc) ;
366+ self . progress . set_position ( new ) ;
367367 }
368368 poll
369369 }
@@ -379,8 +379,8 @@ impl<W: tokio::io::AsyncSeek + Unpin> tokio::io::AsyncSeek for ProgressBarIter<W
379379 fn poll_complete ( mut self : Pin < & mut Self > , cx : & mut Context < ' _ > ) -> Poll < io:: Result < u64 > > {
380380 let poll = Pin :: new ( & mut self . it ) . poll_complete ( cx) ;
381381 if let Poll :: Ready ( Ok ( pos) ) = & poll {
382- let newpos = self . seek_max . update_seek ( * pos) ;
383- self . progress . set_position ( newpos ) ;
382+ let new = self . seek_max . update_seek ( * pos) ;
383+ self . progress . set_position ( new ) ;
384384 }
385385
386386 poll
@@ -399,9 +399,9 @@ impl<W: tokio::io::AsyncBufRead + Unpin + tokio::io::AsyncRead> tokio::io::Async
399399
400400 fn consume ( mut self : Pin < & mut Self > , amt : usize ) {
401401 Pin :: new ( & mut self . it ) . consume ( amt) ;
402- let oldprog = self . progress . position ( ) ;
403- let newprog = self . seek_max . update_seq ( oldprog , amt. try_into ( ) . unwrap ( ) ) ;
404- self . progress . set_position ( newprog ) ;
402+ let pos = self . progress . position ( ) ;
403+ let new = self . seek_max . update_seq ( pos , amt as u64 ) ;
404+ self . progress . set_position ( new ) ;
405405 }
406406}
407407
0 commit comments