diff options
| author | Michael Darakananda <pongad@gmail.com> | 2014-03-07 16:15:50 -0500 |
|---|---|---|
| committer | Michael Darakananda <pongad@gmail.com> | 2014-03-12 19:17:36 -0400 |
| commit | f079c94f723f8c67319da8c727324b2011d7b36f (patch) | |
| tree | 18d17550682a3704d058286fdf4ab0dcf37523be /src/libstd | |
| parent | 3316a0e6b2ad9352bab58e7c046ef3d212411d82 (diff) | |
| download | rust-f079c94f723f8c67319da8c727324b2011d7b36f.tar.gz rust-f079c94f723f8c67319da8c727324b2011d7b36f.zip | |
rustc: Remove matching on ~str from the language
The `~str` type is not long for this world as it will be superseded by the soon-to-come DST changes for the language. The new type will be `~Str`, and matching over the allocation will no longer be supported. Matching on `&str` will continue to work, in both a pre and post DST world.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/local_data.rs | 4 | ||||
| -rw-r--r-- | src/libstd/task.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/local_data.rs b/src/libstd/local_data.rs index 6b854daabda..9fc635647f3 100644 --- a/src/libstd/local_data.rs +++ b/src/libstd/local_data.rs @@ -398,8 +398,8 @@ mod tests { } }); modify(my_key, |data| { - match data { - Some(~"first data") => Some(~"next data"), + match data.as_ref().map(|s| s.as_slice()) { + Some("first data") => Some(~"next data"), Some(ref val) => fail!("wrong value: {}", *val), None => fail!("missing value") } diff --git a/src/libstd/task.rs b/src/libstd/task.rs index 1de5322b157..16ac46186df 100644 --- a/src/libstd/task.rs +++ b/src/libstd/task.rs @@ -387,8 +387,8 @@ fn test_back_to_the_future_result() { fn test_try_success() { match try(proc() { ~"Success!" - }) { - result::Ok(~"Success!") => (), + }).as_ref().map(|s| s.as_slice()) { + result::Ok("Success!") => (), _ => fail!() } } |
