Skip to content

Commit 086c0dd

Browse files
committed
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.
1 parent 122c94d commit 086c0dd

File tree

14 files changed

+310
-391
lines changed

14 files changed

+310
-391
lines changed

src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ syn keyword rustTrait Primitive Int Float ToStrRadix ToPrimitive FromPrimitive
8787
syn keyword rustTrait GenericPath Path PosixPath WindowsPath
8888
syn keyword rustTrait RawPtr
8989
syn keyword rustTrait Buffer Writer Reader Seek
90-
syn keyword rustTrait SendStr SendStrOwned SendStrStatic IntoSendStr
91-
syn keyword rustTrait Str StrVector StrSlice OwnedStr
90+
syn keyword rustTrait Str StrVector StrSlice OwnedStr IntoMaybeOwned
9291
syn keyword rustTrait IterBytes
9392
syn keyword rustTrait ToStr IntoStr
9493
syn keyword rustTrait CloneableTuple ImmutableTuple

src/libextra/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,8 +893,8 @@ pub fn run_test(force_ignore: bool,
893893
spawn(proc() {
894894
let mut task = task::task();
895895
task.name(match desc.name {
896-
DynTestName(ref name) => SendStrOwned(name.clone()),
897-
StaticTestName(name) => SendStrStatic(name),
896+
DynTestName(ref name) => name.to_owned().into_maybe_owned(),
897+
StaticTestName(name) => name.into_maybe_owned()
898898
});
899899
let result_future = task.future_result();
900900
task.spawn(testfn);

src/libgreen/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ pub fn run(main: proc()) -> int {
257257
let (port, chan) = Chan::new();
258258
let mut opts = TaskOpts::new();
259259
opts.notify_chan = Some(chan);
260-
opts.name = Some(SendStrStatic("<main>"));
260+
opts.name = Some("<main>".into_maybe_owned());
261261
pool.spawn(opts, main);
262262

263263
// Wait for the main task to return, and set the process error code

src/libgreen/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ mod tests {
510510
#[test]
511511
fn smoke_opts() {
512512
let mut opts = TaskOpts::new();
513-
opts.name = Some(SendStrStatic("test"));
513+
opts.name = Some("test".into_maybe_owned());
514514
opts.stack_size = Some(20 * 4096);
515515
let (p, c) = Chan::new();
516516
opts.notify_chan = Some(c);

src/libnative/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ mod tests {
294294
#[test]
295295
fn smoke_opts() {
296296
let mut opts = TaskOpts::new();
297-
opts.name = Some(SendStrStatic("test"));
297+
opts.name = Some("test".into_maybe_owned());
298298
opts.stack_size = Some(20 * 4096);
299299
let (p, c) = Chan::new();
300300
opts.notify_chan = Some(c);

src/libstd/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ pub mod vec_ng;
117117
pub mod str;
118118

119119
pub mod ascii;
120-
pub mod send_str;
121120

122121
pub mod ptr;
123122
pub mod owned;

src/libstd/prelude.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ pub use num::{Primitive, Int, Float, ToStrRadix, ToPrimitive, FromPrimitive};
6363
pub use path::{GenericPath, Path, PosixPath, WindowsPath};
6464
pub use ptr::RawPtr;
6565
pub use io::{Buffer, Writer, Reader, Seek};
66-
pub use send_str::{SendStr, SendStrOwned, SendStrStatic, IntoSendStr};
67-
pub use str::{Str, StrVector, StrSlice, OwnedStr};
66+
pub use str::{Str, StrVector, StrSlice, OwnedStr, IntoMaybeOwned};
6867
pub use to_bytes::IterBytes;
6968
pub use to_str::{ToStr, IntoStr};
7069
pub use tuple::{CloneableTuple, ImmutableTuple};

src/libstd/rt/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use rt::local::Local;
3030
use rt::local_heap::LocalHeap;
3131
use rt::rtio::LocalIo;
3232
use rt::unwind::Unwinder;
33-
use send_str::SendStr;
33+
use str::SendStr;
3434
use sync::arc::UnsafeArc;
3535
use sync::atomics::{AtomicUint, SeqCst};
3636
use task::{TaskResult, TaskOpts};

src/libstd/send_str.rs

Lines changed: 0 additions & 246 deletions
This file was deleted.

0 commit comments

Comments
 (0)