about summary refs log tree commit diff
path: root/src/libstd/task.rs
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2014-11-21 17:10:42 -0500
committerJorge Aparicio <japaricious@gmail.com>2014-11-25 11:22:23 -0500
commit3293ab14e24d136d0482bb18afef577aebed251e (patch)
treec21d2568d6eaf1cc1835034cf2557277c4e8d58b /src/libstd/task.rs
parent48ca6d1840818e4a8977d00ed62cf0e8e0e5d193 (diff)
downloadrust-3293ab14e24d136d0482bb18afef577aebed251e.tar.gz
rust-3293ab14e24d136d0482bb18afef577aebed251e.zip
Deprecate MaybeOwned[Vector] in favor of Cow
Diffstat (limited to 'src/libstd/task.rs')
-rw-r--r--src/libstd/task.rs20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/libstd/task.rs b/src/libstd/task.rs
index c852b4efbd8..a0ee08570d9 100644
--- a/src/libstd/task.rs
+++ b/src/libstd/task.rs
@@ -44,16 +44,17 @@
                will likely be renamed from `task` to `thread`."]
 
 use any::Any;
+use borrow::IntoCow;
+use boxed::Box;
 use comm::channel;
 use io::{Writer, stdio};
 use kinds::{Send, marker};
 use option::{None, Some, Option};
-use boxed::Box;
 use result::Result;
 use rustrt::local::Local;
-use rustrt::task;
 use rustrt::task::Task;
-use str::{Str, SendStr, IntoMaybeOwned};
+use rustrt::task;
+use str::{Str, SendStr};
 use string::{String, ToString};
 use sync::Future;
 
@@ -101,8 +102,8 @@ impl TaskBuilder {
     /// Name the task-to-be. Currently the name is used for identification
     /// only in panic messages.
     #[unstable = "IntoMaybeOwned will probably change."]
-    pub fn named<T: IntoMaybeOwned<'static>>(mut self, name: T) -> TaskBuilder {
-        self.name = Some(name.into_maybe_owned());
+    pub fn named<T: IntoCow<'static, String, str>>(mut self, name: T) -> TaskBuilder {
+        self.name = Some(name.into_cow());
         self
     }
 
@@ -264,12 +265,13 @@ pub fn failing() -> bool {
 #[cfg(test)]
 mod test {
     use any::{Any, AnyRefExt};
+    use borrow::IntoCow;
     use boxed::BoxAny;
-    use result;
+    use prelude::*;
     use result::{Ok, Err};
-    use string::String;
+    use result;
     use std::io::{ChanReader, ChanWriter};
-    use prelude::*;
+    use string::String;
     use super::*;
 
     // !!! These tests are dangerous. If something is buggy, they will hang, !!!
@@ -298,7 +300,7 @@ mod test {
 
     #[test]
     fn test_send_named_task() {
-        TaskBuilder::new().named("ada lovelace".into_maybe_owned()).try(proc() {
+        TaskBuilder::new().named("ada lovelace".into_cow()).try(proc() {
             assert!(name().unwrap() == "ada lovelace".to_string());
         }).map_err(|_| ()).unwrap();
     }