File tree Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Expand file tree Collapse file tree 4 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -175,9 +175,9 @@ impl AsyncReadManagedAt for File {
175175
176176 async fn read_managed_at < ' a > (
177177 & self ,
178- pos : u64 ,
179178 buffer_pool : & ' a Self :: BufferPool ,
180179 len : usize ,
180+ pos : u64 ,
181181 ) -> io:: Result < Self :: Buffer < ' a > > {
182182 let fd = self . inner . to_shared_fd ( ) ;
183183 let buffer_pool = buffer_pool. try_inner ( ) ?;
Original file line number Diff line number Diff line change @@ -384,7 +384,7 @@ impl AsyncReadManaged for &NamedPipeClient {
384384 len : usize ,
385385 ) -> io:: Result < Self :: Buffer < ' a > > {
386386 // The position is ignored.
387- self . handle . read_managed_at ( 0 , buffer_pool, len) . await
387+ self . handle . read_managed_at ( buffer_pool, len, 0 ) . await
388388 }
389389}
390390
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ async fn test_read_file() {
2222
2323 let file = File :: open ( tempfile. path ( ) ) . await . unwrap ( ) ;
2424 let buffer_pool = BufferPool :: new ( 1 , 15 ) . unwrap ( ) ;
25- let buf = file. read_managed_at ( 0 , & buffer_pool, 0 ) . await . unwrap ( ) ;
25+ let buf = file. read_managed_at ( & buffer_pool, 0 , 0 ) . await . unwrap ( ) ;
2626
2727 assert_eq ! ( buf. len( ) , HELLO . len( ) ) ;
2828 assert_eq ! ( buf. as_ref( ) , HELLO ) ;
Original file line number Diff line number Diff line change @@ -41,9 +41,9 @@ pub trait AsyncReadManagedAt {
4141 /// read max len
4242 async fn read_managed_at < ' a > (
4343 & self ,
44- pos : u64 ,
4544 buffer_pool : & ' a Self :: BufferPool ,
4645 len : usize ,
46+ pos : u64 ,
4747 ) -> IoResult < Self :: Buffer < ' a > > ;
4848}
4949
6262 let pos = self . position ( ) ;
6363 let buf = self
6464 . get_ref ( )
65- . read_managed_at ( pos , buffer_pool, len)
65+ . read_managed_at ( buffer_pool, len, pos )
6666 . await ?;
6767 self . set_position ( pos + buf. len ( ) as u64 ) ;
6868 Ok ( buf)
You can’t perform that action at this time.
0 commit comments