]> git.lizzy.rs Git - rust.git/blobdiff - src/libsync/future.rs
Replace all ~"" with "".to_owned()
[rust.git] / src / libsync / future.rs
index cfe942afc129b1231ce43b294cf930f91490e63d..2836f9cb4be82d0246f64ec1f539eb55360a1a03 100644 (file)
@@ -34,7 +34,7 @@ pub struct Future<A> {
 }
 
 enum FutureState<A> {
-    Pending(proc:Send() -> A),
+    Pending(proc():Send -> A),
     Evaluating,
     Forced(A)
 }
@@ -90,7 +90,7 @@ pub fn from_value(val: A) -> Future<A> {
         Future {state: Forced(val)}
     }
 
-    pub fn from_fn(f: proc:Send() -> A) -> Future<A> {
+    pub fn from_fn(f: proc():Send -> A) -> Future<A> {
         /*!
          * Create a future from a function.
          *
@@ -117,7 +117,7 @@ pub fn from_receiver(rx: Receiver<A>) -> Future<A> {
         })
     }
 
-    pub fn spawn(blk: proc:Send() -> A) -> Future<A> {
+    pub fn spawn(blk: proc():Send -> A) -> Future<A> {
         /*!
          * Create a future from a unique closure.
          *
@@ -143,34 +143,34 @@ mod test {
 
     #[test]
     fn test_from_value() {
-        let mut f = Future::from_value(~"snail");
-        assert_eq!(f.get(), ~"snail");
+        let mut f = Future::from_value("snail".to_owned());
+        assert_eq!(f.get(), "snail".to_owned());
     }
 
     #[test]
     fn test_from_receiver() {
         let (tx, rx) = channel();
-        tx.send(~"whale");
+        tx.send("whale".to_owned());
         let mut f = Future::from_receiver(rx);
-        assert_eq!(f.get(), ~"whale");
+        assert_eq!(f.get(), "whale".to_owned());
     }
 
     #[test]
     fn test_from_fn() {
-        let mut f = Future::from_fn(proc() ~"brail");
-        assert_eq!(f.get(), ~"brail");
+        let mut f = Future::from_fn(proc() "brail".to_owned());
+        assert_eq!(f.get(), "brail".to_owned());
     }
 
     #[test]
     fn test_interface_get() {
-        let mut f = Future::from_value(~"fail");
-        assert_eq!(f.get(), ~"fail");
+        let mut f = Future::from_value("fail".to_owned());
+        assert_eq!(f.get(), "fail".to_owned());
     }
 
     #[test]
     fn test_interface_unwrap() {
-        let f = Future::from_value(~"fail");
-        assert_eq!(f.unwrap(), ~"fail");
+        let f = Future::from_value("fail".to_owned());
+        assert_eq!(f.unwrap(), "fail".to_owned());
     }
 
     #[test]
@@ -181,8 +181,8 @@ fn test_get_ref_method() {
 
     #[test]
     fn test_spawn() {
-        let mut f = Future::spawn(proc() ~"bale");
-        assert_eq!(f.get(), ~"bale");
+        let mut f = Future::spawn(proc() "bale".to_owned());
+        assert_eq!(f.get(), "bale".to_owned());
     }
 
     #[test]