diff options
| author | Kevin Ballard <kevin@sb.org> | 2014-02-07 16:36:59 -0800 |
|---|---|---|
| committer | Kevin Ballard <kevin@sb.org> | 2014-02-07 22:31:52 -0800 |
| commit | 086c0dd33febb752b036fba62dcfb8aa22a51642 (patch) | |
| tree | 2543a402c3d2ce04b4d7cd7e8c60da6c5fb40371 /src/libstd/task.rs | |
| parent | 122c94d2f3909a06a5dd172b423b9b56a2f17039 (diff) | |
| download | rust-086c0dd33febb752b036fba62dcfb8aa22a51642.tar.gz rust-086c0dd33febb752b036fba62dcfb8aa22a51642.zip | |
Delete send_str, rewrite clients on top of MaybeOwned<'static>
Declare a `type SendStr = MaybeOwned<'static>` to ease readibility of types that needed the old SendStr behavior. Implement all the traits for MaybeOwned that SendStr used to implement.
Diffstat (limited to 'src/libstd/task.rs')
| -rw-r--r-- | src/libstd/task.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstd/task.rs b/src/libstd/task.rs index 078933be78f..921d0feaa8b 100644 --- a/src/libstd/task.rs +++ b/src/libstd/task.rs @@ -62,8 +62,7 @@ use option::{None, Some, Option}; use result::{Result, Ok, Err}; use rt::local::Local; use rt::task::Task; -use send_str::{SendStr, IntoSendStr}; -use str::Str; +use str::{Str, SendStr, IntoMaybeOwned}; #[cfg(test)] use any::{AnyOwnExt, AnyRefExt}; #[cfg(test)] use comm::SharedChan; @@ -190,8 +189,8 @@ impl TaskBuilder { /// Name the task-to-be. Currently the name is used for identification /// only in failure messages. - pub fn name<S: IntoSendStr>(&mut self, name: S) { - self.opts.name = Some(name.into_send_str()); + pub fn name<S: IntoMaybeOwned<'static>>(&mut self, name: S) { + self.opts.name = Some(name.into_maybe_owned()); } /** @@ -396,7 +395,7 @@ fn test_static_named_task() { #[test] fn test_send_named_task() { let mut t = task(); - t.name("ada lovelace".into_send_str()); + t.name("ada lovelace".into_maybe_owned()); t.spawn(proc() { with_task_name(|name| { assert!(name.unwrap() == "ada lovelace"); |
