File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
branches/snap-stage3/src/libstd Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 20fad0f5fff381210bfe79b35a5fe8332ec86b34
4
+ refs/heads/snap-stage3: 39fafd655a85a2af9cddf59b70a687b44570fb6f
5
5
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -1079,25 +1079,37 @@ pub mod traits {}
1079
1079
pub trait Str {
1080
1080
/// Work with `self` as a slice.
1081
1081
fn as_slice<'a>(&'a self) -> &'a str;
1082
+
1083
+ /// Convert `self` into a ~str.
1084
+ fn into_owned(self) -> ~str;
1082
1085
}
1083
1086
1084
1087
impl<'self> Str for &'self str {
1085
1088
#[inline]
1086
1089
fn as_slice<'a>(&'a self) -> &'a str { *self }
1090
+
1091
+ #[inline]
1092
+ fn into_owned(self) -> ~str { self.to_owned() }
1087
1093
}
1088
1094
1089
1095
impl<'self> Str for ~str {
1090
1096
#[inline]
1091
1097
fn as_slice<'a>(&'a self) -> &'a str {
1092
1098
let s: &'a str = *self; s
1093
1099
}
1100
+
1101
+ #[inline]
1102
+ fn into_owned(self) -> ~str { self }
1094
1103
}
1095
1104
1096
1105
impl<'self> Str for @str {
1097
1106
#[inline]
1098
1107
fn as_slice<'a>(&'a self) -> &'a str {
1099
1108
let s: &'a str = *self; s
1100
1109
}
1110
+
1111
+ #[inline]
1112
+ fn into_owned(self) -> ~str { self.to_owned() }
1101
1113
}
1102
1114
1103
1115
impl<'self> Container for &'self str {
You can’t perform that action at this time.
0 commit comments