about summary refs log tree commit diff
path: root/src/libstd/rt/uv
diff options
context:
space:
mode:
authorMarvin Löbel <loebel.marvin@gmail.com>2013-08-04 01:59:24 +0200
committerMarvin Löbel <loebel.marvin@gmail.com>2013-08-05 22:42:21 +0200
commit0ac7a219f043d3b1c8c239089d9dd6e6c9fa830b (patch)
tree6dbb028659dbc0931ec23398e529549c84bba0a4 /src/libstd/rt/uv
parentd8b299d179653cbde783f62f70b5531dbaa5c5a6 (diff)
Updated std::Option, std::Either and std::Result
- Made naming schemes consistent between Option, Result and Either
- Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None)
- Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
Diffstat (limited to 'src/libstd/rt/uv')
-rw-r--r--src/libstd/rt/uv/net.rs6
-rw-r--r--src/libstd/rt/uv/uvio.rs2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/rt/uv/net.rs b/src/libstd/rt/uv/net.rs
index 67d3bbef8a9..fd3042899f6 100644
--- a/src/libstd/rt/uv/net.rs
+++ b/src/libstd/rt/uv/net.rs
@@ -108,7 +108,7 @@ fn uv_socket_addr_as_socket_addr<T>(addr: UvSocketAddr, f: &fn(SocketAddr) -> T)
                             "" => ~[],
                             // IPv4-Mapped/Compatible IPv6 Address?
                             s if s.find('.').is_some() => {
-                                let i = s.rfind(':').get_or_default(-1);
+                                let i = s.rfind(':').unwrap_or_default(-1);
 
                                 let b = s.slice(i + 1, s.len()); // the ipv4 part
 
@@ -614,7 +614,7 @@ mod test {
             do tcp_watcher.connect(addr) |stream_watcher, status| {
                 rtdebug!("tcp_watcher.connect!");
                 assert!(status.is_some());
-                assert_eq!(status.get().name(), ~"ECONNREFUSED");
+                assert_eq!(status.unwrap().name(), ~"ECONNREFUSED");
                 stream_watcher.close(||());
             }
             loop_.run();
@@ -632,7 +632,7 @@ mod test {
             do tcp_watcher.connect(addr) |stream_watcher, status| {
                 rtdebug!("tcp_watcher.connect!");
                 assert!(status.is_some());
-                assert_eq!(status.get().name(), ~"ECONNREFUSED");
+                assert_eq!(status.unwrap().name(), ~"ECONNREFUSED");
                 stream_watcher.close(||());
             }
             loop_.run();
diff --git a/src/libstd/rt/uv/uvio.rs b/src/libstd/rt/uv/uvio.rs
index 85cf660a5f1..70a397199ab 100644
--- a/src/libstd/rt/uv/uvio.rs
+++ b/src/libstd/rt/uv/uvio.rs
@@ -278,7 +278,7 @@ impl IoFactory for UvIoFactory {
                     rtdebug!("status is some");
                     let task_cell = Cell::new(task_cell.take());
                     do stream_watcher.close {
-                        let res = Err(uv_error_to_io_error(status.get()));
+                        let res = Err(uv_error_to_io_error(status.unwrap()));
                         unsafe { (*result_cell_ptr).put_back(res); }
                         let scheduler = Local::take::<Scheduler>();
                         scheduler.resume_blocked_task_immediately(task_cell.take());