Skip to content

Commit 086849b

Browse files
committed
libextra: Remove @str from all the libraries
1 parent 10064b4 commit 086849b

File tree

13 files changed

+12
-169
lines changed

13 files changed

+12
-169
lines changed

src/libextra/serialize.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -310,18 +310,6 @@ impl<D:Decoder> Decodable<D> for ~str {
310310
}
311311
}
312312

313-
impl<S:Encoder> Encodable<S> for @str {
314-
fn encode(&self, s: &mut S) {
315-
s.emit_str(*self)
316-
}
317-
}
318-
319-
impl<D:Decoder> Decodable<D> for @str {
320-
fn decode(d: &mut D) -> @str {
321-
d.read_str().to_managed()
322-
}
323-
}
324-
325313
impl<S:Encoder> Encodable<S> for f32 {
326314
fn encode(&self, s: &mut S) {
327315
s.emit_f32(*self)

src/libstd/at_vec.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ mod test {
338338
assert_eq!(to_managed::<int>([]), @[]);
339339
assert_eq!(to_managed([true]), @[true]);
340340
assert_eq!(to_managed([1, 2, 3, 4, 5]), @[1, 2, 3, 4, 5]);
341-
assert_eq!(to_managed([@"abc", @"123"]), @[@"abc", @"123"]);
342341
assert_eq!(to_managed([@[42]]), @[@[42]]);
343342
}
344343

src/libstd/fmt/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,6 @@ delegate!( u8 to Unsigned)
11671167
delegate!( u16 to Unsigned)
11681168
delegate!( u32 to Unsigned)
11691169
delegate!( u64 to Unsigned)
1170-
delegate!(@str to String)
11711170
delegate!(~str to String)
11721171
delegate!(&'a str to String)
11731172
delegate!(bool to Bool)

src/libstd/path/mod.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -604,19 +604,6 @@ impl BytesContainer for ~str {
604604
fn is_str(_: Option<~str>) -> bool { true }
605605
}
606606

607-
impl BytesContainer for @str {
608-
#[inline]
609-
fn container_as_bytes<'a>(&'a self) -> &'a [u8] {
610-
self.as_bytes()
611-
}
612-
#[inline]
613-
fn container_as_str<'a>(&'a self) -> Option<&'a str> {
614-
Some(self.as_slice())
615-
}
616-
#[inline]
617-
fn is_str(_: Option<@str>) -> bool { true }
618-
}
619-
620607
impl<'a> BytesContainer for &'a [u8] {
621608
#[inline]
622609
fn container_as_bytes<'a>(&'a self) -> &'a [u8] {

src/libstd/path/posix.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,6 @@ mod tests {
830830
t!(s: "a/b/c", ["d", "/e"], "/e");
831831
t!(s: "a/b/c", ["d", "/e", "f"], "/e/f");
832832
t!(s: "a/b/c", [~"d", ~"e"], "a/b/c/d/e");
833-
t!(s: "a/b/c", [@"d", @"e"], "a/b/c/d/e");
834833
t!(v: b!("a/b/c"), [b!("d"), b!("e")], b!("a/b/c/d/e"));
835834
t!(v: b!("a/b/c"), [b!("d"), b!("/e"), b!("f")], b!("/e/f"));
836835
t!(v: b!("a/b/c"), [b!("d").to_owned(), b!("e").to_owned()], b!("a/b/c/d/e"));
@@ -940,7 +939,6 @@ mod tests {
940939
t!(s: "a/b/c", ["..", "d"], "a/b/d");
941940
t!(s: "a/b/c", ["d", "/e", "f"], "/e/f");
942941
t!(s: "a/b/c", [~"d", ~"e"], "a/b/c/d/e");
943-
t!(s: "a/b/c", [@"d", @"e"], "a/b/c/d/e");
944942
t!(v: b!("a/b/c"), [b!("d"), b!("e")], b!("a/b/c/d/e"));
945943
t!(v: b!("a/b/c"), [b!("d").to_owned(), b!("e").to_owned()], b!("a/b/c/d/e"));
946944
t!(v: b!("a/b/c"), [to_man(b!("d").to_owned()), to_man(b!("e").to_owned())],

src/libstd/path/windows.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,6 @@ mod tests {
16101610
t!(s: "a\\b\\c", ["d", "\\e"], "\\e");
16111611
t!(s: "a\\b\\c", ["d", "\\e", "f"], "\\e\\f");
16121612
t!(s: "a\\b\\c", [~"d", ~"e"], "a\\b\\c\\d\\e");
1613-
t!(s: "a\\b\\c", [@"d", @"e"], "a\\b\\c\\d\\e");
16141613
t!(v: b!("a\\b\\c"), [b!("d"), b!("e")], b!("a\\b\\c\\d\\e"));
16151614
t!(v: b!("a\\b\\c"), [b!("d"), b!("\\e"), b!("f")], b!("\\e\\f"));
16161615
t!(v: b!("a\\b\\c"), [b!("d").to_owned(), b!("e").to_owned()], b!("a\\b\\c\\d\\e"));
@@ -1755,7 +1754,6 @@ mod tests {
17551754
t!(s: "a\\b\\c", ["..", "d"], "a\\b\\d");
17561755
t!(s: "a\\b\\c", ["d", "\\e", "f"], "\\e\\f");
17571756
t!(s: "a\\b\\c", [~"d", ~"e"], "a\\b\\c\\d\\e");
1758-
t!(s: "a\\b\\c", [@"d", @"e"], "a\\b\\c\\d\\e");
17591757
t!(v: b!("a\\b\\c"), [b!("d"), b!("e")], b!("a\\b\\c\\d\\e"));
17601758
t!(v: b!("a\\b\\c"), [b!("d").to_owned(), b!("e").to_owned()], b!("a\\b\\c\\d\\e"));
17611759
t!(v: b!("a\\b\\c"), [to_man(b!("d").to_owned()), to_man(b!("e").to_owned())],

src/libstd/reflect.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
183183
}
184184

185185
fn visit_estr_box(&mut self) -> bool {
186-
self.align_to::<@str>();
187-
if ! self.inner.visit_estr_box() { return false; }
188-
self.bump_past::<@str>();
189186
true
190187
}
191188

src/libstd/repr.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
272272
}
273273

274274
fn visit_estr_box(&mut self) -> bool {
275-
self.get::<@str>(|this, s| {
276-
this.writer.write(['@' as u8]);
277-
this.write_escaped_slice(*s);
278-
})
275+
true
279276
}
280277

281278
fn visit_estr_uniq(&mut self) -> bool {
@@ -628,7 +625,6 @@ fn test_repr() {
628625
exact_test(&false, "false");
629626
exact_test(&1.234, "1.234f64");
630627
exact_test(&(&"hello"), "\"hello\"");
631-
exact_test(&(@"hello"), "@\"hello\"");
632628
exact_test(&(~"he\u10f3llo"), "~\"he\\u10f3llo\"");
633629

634630
exact_test(&(@10), "@10");

src/libstd/send_str.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,15 +185,13 @@ mod tests {
185185
assert_eq!(s.len(), 5);
186186
assert_eq!(s.as_slice(), "abcde");
187187
assert_eq!(s.to_str(), ~"abcde");
188-
assert!(s.equiv(&@"abcde"));
189188
assert!(s.lt(&SendStrOwned(~"bcdef")));
190189
assert_eq!(SendStrStatic(""), Default::default());
191190
192191
let o = SendStrOwned(~"abcde");
193192
assert_eq!(o.len(), 5);
194193
assert_eq!(o.as_slice(), "abcde");
195194
assert_eq!(o.to_str(), ~"abcde");
196-
assert!(o.equiv(&@"abcde"));
197195
assert!(o.lt(&SendStrStatic("bcdef")));
198196
assert_eq!(SendStrOwned(~""), Default::default());
199197

0 commit comments

Comments
 (0)