Skip to content

Commit b3f7f75

Browse files
committed
std::rt: Some I/O cleanup
1 parent d84a7b5 commit b3f7f75

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/libstd/rt/uv/file.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,17 @@ impl NativeHandle<*uvll::uv_fs_t> for FsRequest {
139139
match self { &FsRequest(ptr) => ptr }
140140
}
141141
}
142-
fn sync_cleanup(loop_: &Loop, result: int)
143-
-> Result<int, UvError> {
144-
match status_to_maybe_uv_error_with_loop(loop_.native_handle(), result as i32) {
145-
Some(err) => Err(err),
146-
None => Ok(result)
147-
}
142+
143+
fn sync_cleanup(loop_: &Loop, result: int)
144+
-> Result<int, UvError> {
145+
match status_to_maybe_uv_error_with_loop(loop_.native_handle(), result as i32) {
146+
Some(err) => Err(err),
147+
None => Ok(result)
148148
}
149+
}
149150

150151
pub struct FileDescriptor(c_int);
152+
151153
impl FileDescriptor {
152154
fn new(fd: c_int) -> FileDescriptor {
153155
FileDescriptor(fd)

src/libstd/rt/uv/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ pub type UdpReceiveCallback = ~fn(UdpWatcher, int, Buf, SocketAddr, uint, Option
132132
pub type UdpSendCallback = ~fn(UdpWatcher, Option<UvError>);
133133

134134

135-
/// Callbacks used by StreamWatchers, set as custom data on the foreign handle
135+
/// Callbacks used by StreamWatchers, set as custom data on the foreign handle.
136+
/// XXX: Would be better not to have all watchers allocate room for all callback types.
136137
struct WatcherData {
137138
read_cb: Option<ReadCallback>,
138139
write_cb: Option<ConnectionCallback>,

0 commit comments

Comments
 (0)