@@ -12,7 +12,7 @@ use prelude::*;
12
12
use ptr:: null;
13
13
use libc:: c_void;
14
14
use rt:: uv:: { Request , NativeHandle , Loop , FsCallback , Buf ,
15
- status_to_maybe_uv_error_with_loop , UvError } ;
15
+ status_to_maybe_uv_error , UvError } ;
16
16
use rt:: uv:: uvll;
17
17
use rt:: uv:: uvll:: * ;
18
18
use super :: super :: io:: support:: PathLike ;
@@ -62,7 +62,7 @@ impl FsRequest {
62
62
pub fn open_sync < P : PathLike > ( loop_ : & Loop , path : & P , flags : int , mode : int )
63
63
-> Result < int , UvError > {
64
64
let result = FsRequest :: open_common ( loop_, path, flags, mode, None ) ;
65
- sync_cleanup ( loop_ , result)
65
+ sync_cleanup ( result)
66
66
}
67
67
68
68
fn unlink_common < P : PathLike > ( loop_ : & Loop , path : & P , cb : Option < FsCallback > ) -> int {
@@ -83,11 +83,11 @@ impl FsRequest {
83
83
}
84
84
pub fn unlink < P : PathLike > ( loop_ : & Loop , path : & P , cb : FsCallback ) {
85
85
let result = FsRequest :: unlink_common ( loop_, path, Some ( cb) ) ;
86
- sync_cleanup ( loop_ , result) ;
86
+ sync_cleanup ( result) ;
87
87
}
88
88
pub fn unlink_sync < P : PathLike > ( loop_ : & Loop , path : & P ) -> Result < int , UvError > {
89
89
let result = FsRequest :: unlink_common ( loop_, path, None ) ;
90
- sync_cleanup ( loop_ , result)
90
+ sync_cleanup ( result)
91
91
}
92
92
93
93
pub fn install_req_data ( & self , cb : Option < FsCallback > ) {
@@ -140,9 +140,9 @@ impl NativeHandle<*uvll::uv_fs_t> for FsRequest {
140
140
}
141
141
}
142
142
143
- fn sync_cleanup ( loop_ : & Loop , result : int )
143
+ fn sync_cleanup ( result : int )
144
144
-> Result < int , UvError > {
145
- match status_to_maybe_uv_error_with_loop ( loop_ . native_handle ( ) , result as i32 ) {
145
+ match status_to_maybe_uv_error ( result as i32 ) {
146
146
Some ( err) => Err ( err) ,
147
147
None => Ok ( result)
148
148
}
@@ -186,7 +186,7 @@ impl FileDescriptor {
186
186
pub fn write_sync ( & mut self , loop_ : & Loop , buf : Buf , offset : i64 )
187
187
-> Result < int , UvError > {
188
188
let result = self . write_common ( loop_, buf, offset, None ) ;
189
- sync_cleanup ( loop_ , result)
189
+ sync_cleanup ( result)
190
190
}
191
191
192
192
fn read_common ( & mut self , loop_ : & Loop , buf : Buf ,
@@ -214,7 +214,7 @@ impl FileDescriptor {
214
214
pub fn read_sync ( & mut self , loop_ : & Loop , buf : Buf , offset : i64 )
215
215
-> Result < int , UvError > {
216
216
let result = self . read_common ( loop_, buf, offset, None ) ;
217
- sync_cleanup ( loop_ , result)
217
+ sync_cleanup ( result)
218
218
}
219
219
220
220
fn close_common ( self , loop_ : & Loop , cb : Option < FsCallback > ) -> int {
@@ -236,12 +236,11 @@ impl FileDescriptor {
236
236
}
237
237
pub fn close_sync ( self , loop_ : & Loop ) -> Result < int , UvError > {
238
238
let result = self . close_common ( loop_, None ) ;
239
- sync_cleanup ( loop_ , result)
239
+ sync_cleanup ( result)
240
240
}
241
241
}
242
242
extern fn compl_cb ( req : * uv_fs_t ) {
243
243
let mut req: FsRequest = NativeHandle :: from_native_handle ( req) ;
244
- let loop_ = req. get_loop ( ) ;
245
244
// pull the user cb out of the req data
246
245
let cb = {
247
246
let data = req. get_req_data ( ) ;
@@ -252,8 +251,7 @@ extern fn compl_cb(req: *uv_fs_t) {
252
251
// in uv_fs_open calls, the result will be the fd in the
253
252
// case of success, otherwise it's -1 indicating an error
254
253
let result = req. get_result ( ) ;
255
- let status = status_to_maybe_uv_error_with_loop (
256
- loop_. native_handle ( ) , result) ;
254
+ let status = status_to_maybe_uv_error ( result) ;
257
255
// we have a req and status, call the user cb..
258
256
// only giving the user a ref to the FsRequest, as we
259
257
// have to clean it up, afterwards (and they aren't really
0 commit comments