Skip to content

Commit b714150

Browse files
committed
Remove more functions from std::str. Issue #855
1 parent 6b22640 commit b714150

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

src/lib/str.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ import rustrt::sbuf;
33
import uint::le;
44
export sbuf;
55
// export rustrt;
6-
export eq;
7-
export lteq;
6+
// export eq;
7+
// export lteq;
88
// export hash;
99
// export is_utf8;
1010
// export is_ascii;
1111
export alloc;
12-
export byte_len;
12+
// export byte_len;
1313
export buf;
1414
// export bytes;
1515
// export unsafe_from_byte;
1616
// export str_from_cstr;
1717
// export str_from_buf;
1818
// export push_utf8_bytes;
19-
export from_char;
19+
// export from_char;
2020
// export from_chars;
2121
// export utf8_char_width;
2222
// export char_range_at;
23-
export char_at;
24-
export char_len;
23+
// export char_at;
24+
// export char_len;
2525
// export to_chars;
2626
// export push_char;
2727
// export pop_char;
@@ -30,10 +30,10 @@ export char_len;
3030
// export refcount;
3131
// export index;
3232
// export rindex;
33-
export find;
33+
// export find;
3434
// export starts_with;
3535
// export ends_with;
36-
export substr;
36+
// export substr;
3737
// export slice;
3838
// export shift_byte;
3939
// export pop_byte;
@@ -42,7 +42,7 @@ export substr;
4242
// export split;
4343
// export concat;
4444
// export connect;
45-
export to_upper;
45+
// export to_upper;
4646
// export safe_slice;
4747
export unsafe_from_bytes;
4848
// export is_empty;

src/test/run-pass/spawn-types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
use std;
88

9-
import std::str;
9+
import std::istr;
1010
import std::comm;
1111
import std::task;
1212

1313
type ctx = comm::chan<int>;
1414

15-
fn iotask(cx: ctx, ip: str) { assert (str::eq(ip, "localhost")); }
15+
fn iotask(cx: ctx, ip: -istr) { assert (istr::eq(ip, ~"localhost")); }
1616

1717
fn main() {
1818
let p = comm::port::<int>();
19-
task::spawn(bind iotask(comm::chan(p), "localhost"));
19+
task::spawn(bind iotask(comm::chan(p), ~"localhost"));
2020
}

src/test/run-pass/str-append.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22

33
// -*- rust -*-
44
use std;
5-
import std::str;
5+
import std::istr;
66

77
fn test1() {
8-
let s: str = "hello";
9-
s += "world";
8+
let s: istr = ~"hello";
9+
s += ~"world";
1010
log s;
1111
assert (s[9] == 'd' as u8);
1212
}
1313

1414
fn test2() {
1515
// This tests for issue #163
1616

17-
let ff: str = "abc";
18-
let a: str = ff + "ABC" + ff;
19-
let b: str = "ABC" + ff + "ABC";
17+
let ff: istr = ~"abc";
18+
let a: istr = ff + ~"ABC" + ff;
19+
let b: istr = ~"ABC" + ff + ~"ABC";
2020
log a;
2121
log b;
22-
assert (str::eq(a, "abcABCabc"));
23-
assert (str::eq(b, "ABCabcABC"));
22+
assert (istr::eq(a, ~"abcABCabc"));
23+
assert (istr::eq(b, ~"ABCabcABC"));
2424
}
2525

2626
fn main() { test1(); test2(); }

src/test/run-pass/str-multiline.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
// -*- rust -*-
44
use std;
5-
import std::str;
5+
import std::istr;
66

77
fn main() {
8-
let a: str = "this \
8+
let a: istr = ~"this \
99
is a test";
10-
let b: str =
11-
"this \
10+
let b: istr =
11+
~"this \
1212
is \
1313
another \
1414
test";
15-
assert (str::eq(a, "this is a test"));
16-
assert (str::eq(b, "this is another test"));
15+
assert (istr::eq(a, ~"this is a test"));
16+
assert (istr::eq(b, ~"this is another test"));
1717
}

src/test/run-pass/string-self-append.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
use std;
2-
import std::str;
2+
import std::istr;
33

44
fn main() {
55
// Make sure we properly handle repeated self-appends.
6-
let a: str = "A";
6+
let a: istr = ~"A";
77
let i = 20;
88
let expected_len = 1u;
99
while i > 0 {
10-
log_err str::byte_len(a);
11-
assert (str::byte_len(a) == expected_len);
10+
log_err istr::byte_len(a);
11+
assert (istr::byte_len(a) == expected_len);
1212
a += a;
1313
i -= 1;
1414
expected_len *= 2u;

0 commit comments

Comments
 (0)