about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-09-04 16:31:55 -0700
committerBrian Anderson <banderson@mozilla.com>2013-09-05 14:21:57 -0700
commitb3f7f758b1f3df8c1d2ded808492b452e4b0e1a0 (patch)
treed516152ed789cc4794af2d016afd42b7de51d5d4 /src/libstd/rt
parentd84a7b5ae3b3a820fb0a26292632856ceb959b3e (diff)
downloadrust-b3f7f758b1f3df8c1d2ded808492b452e4b0e1a0.tar.gz
rust-b3f7f758b1f3df8c1d2ded808492b452e4b0e1a0.zip
std::rt: Some I/O cleanup
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/uv/file.rs14
-rw-r--r--src/libstd/rt/uv/mod.rs3
2 files changed, 10 insertions, 7 deletions
diff --git a/src/libstd/rt/uv/file.rs b/src/libstd/rt/uv/file.rs
index eaf70242440..440b5c395c7 100644
--- a/src/libstd/rt/uv/file.rs
+++ b/src/libstd/rt/uv/file.rs
@@ -139,15 +139,17 @@ impl NativeHandle<*uvll::uv_fs_t> for FsRequest {
         match self { &FsRequest(ptr) => ptr }
     }
 }
-    fn sync_cleanup(loop_: &Loop, result: int)
-          -> Result<int, UvError> {
-        match status_to_maybe_uv_error_with_loop(loop_.native_handle(), result as i32) {
-            Some(err) => Err(err),
-            None => Ok(result)
-        }
+
+fn sync_cleanup(loop_: &Loop, result: int)
+    -> Result<int, UvError> {
+    match status_to_maybe_uv_error_with_loop(loop_.native_handle(), result as i32) {
+        Some(err) => Err(err),
+        None => Ok(result)
     }
+}
 
 pub struct FileDescriptor(c_int);
+
 impl FileDescriptor {
     fn new(fd: c_int) -> FileDescriptor {
         FileDescriptor(fd)
diff --git a/src/libstd/rt/uv/mod.rs b/src/libstd/rt/uv/mod.rs
index 75b9a5ac553..ea4562068b4 100644
--- a/src/libstd/rt/uv/mod.rs
+++ b/src/libstd/rt/uv/mod.rs
@@ -132,7 +132,8 @@ pub type UdpReceiveCallback = ~fn(UdpWatcher, int, Buf, SocketAddr, uint, Option
 pub type UdpSendCallback = ~fn(UdpWatcher, Option<UvError>);
 
 
-/// Callbacks used by StreamWatchers, set as custom data on the foreign handle
+/// Callbacks used by StreamWatchers, set as custom data on the foreign handle.
+/// XXX: Would be better not to have all watchers allocate room for all callback types.
 struct WatcherData {
     read_cb: Option<ReadCallback>,
     write_cb: Option<ConnectionCallback>,