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 {
175
175
176
176
async fn read_managed_at < ' a > (
177
177
& self ,
178
- pos : u64 ,
179
178
buffer_pool : & ' a Self :: BufferPool ,
180
179
len : usize ,
180
+ pos : u64 ,
181
181
) -> io:: Result < Self :: Buffer < ' a > > {
182
182
let fd = self . inner . to_shared_fd ( ) ;
183
183
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 {
384
384
len : usize ,
385
385
) -> io:: Result < Self :: Buffer < ' a > > {
386
386
// 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
388
388
}
389
389
}
390
390
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ async fn test_read_file() {
22
22
23
23
let file = File :: open ( tempfile. path ( ) ) . await . unwrap ( ) ;
24
24
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 ( ) ;
26
26
27
27
assert_eq ! ( buf. len( ) , HELLO . len( ) ) ;
28
28
assert_eq ! ( buf. as_ref( ) , HELLO ) ;
Original file line number Diff line number Diff line change @@ -41,9 +41,9 @@ pub trait AsyncReadManagedAt {
41
41
/// read max len
42
42
async fn read_managed_at < ' a > (
43
43
& self ,
44
- pos : u64 ,
45
44
buffer_pool : & ' a Self :: BufferPool ,
46
45
len : usize ,
46
+ pos : u64 ,
47
47
) -> IoResult < Self :: Buffer < ' a > > ;
48
48
}
49
49
62
62
let pos = self . position ( ) ;
63
63
let buf = self
64
64
. get_ref ( )
65
- . read_managed_at ( pos , buffer_pool, len)
65
+ . read_managed_at ( buffer_pool, len, pos )
66
66
. await ?;
67
67
self . set_position ( pos + buf. len ( ) as u64 ) ;
68
68
Ok ( buf)
You can’t perform that action at this time.
0 commit comments