|
2 | 2 | import rustrt::sbuf;
|
3 | 3 | import uint::le;
|
4 | 4 | export sbuf;
|
5 |
| -export rustrt; |
| 5 | +// export rustrt; |
6 | 6 | export eq;
|
7 | 7 | export lteq;
|
8 |
| -export hash; |
9 |
| -export is_utf8; |
10 |
| -export is_ascii; |
11 |
| -export alloc; |
| 8 | +// export hash; |
| 9 | +// export is_utf8; |
| 10 | +// export is_ascii; |
| 11 | +// export alloc; |
12 | 12 | export byte_len;
|
13 | 13 | export buf;
|
14 |
| -export bytes; |
15 |
| -export unsafe_from_byte; |
16 |
| -export str_from_cstr; |
17 |
| -export str_from_buf; |
18 |
| -export push_utf8_bytes; |
| 14 | +// export bytes; |
| 15 | +// export unsafe_from_byte; |
| 16 | +// export str_from_cstr; |
| 17 | +// export str_from_buf; |
| 18 | +// export push_utf8_bytes; |
19 | 19 | export from_char;
|
20 |
| -export from_chars; |
21 |
| -export utf8_char_width; |
22 |
| -export char_range_at; |
| 20 | +// export from_chars; |
| 21 | +// export utf8_char_width; |
| 22 | +// export char_range_at; |
23 | 23 | export char_at;
|
24 | 24 | export char_len;
|
25 |
| -export to_chars; |
26 |
| -export push_char; |
27 |
| -export pop_char; |
28 |
| -export shift_char; |
29 |
| -export unshift_char; |
30 |
| -export refcount; |
31 |
| -export index; |
32 |
| -export rindex; |
| 25 | +// export to_chars; |
| 26 | +// export push_char; |
| 27 | +// export pop_char; |
| 28 | +// export shift_char; |
| 29 | +// export unshift_char; |
| 30 | +// export refcount; |
| 31 | +// export index; |
| 32 | +// export rindex; |
33 | 33 | export find;
|
34 |
| -export starts_with; |
35 |
| -export ends_with; |
| 34 | +// export starts_with; |
| 35 | +// export ends_with; |
36 | 36 | export substr;
|
37 |
| -export slice; |
38 |
| -export shift_byte; |
39 |
| -export pop_byte; |
40 |
| -export push_byte; |
41 |
| -export unshift_byte; |
42 |
| -export split; |
43 |
| -export concat; |
44 |
| -export connect; |
| 37 | +// export slice; |
| 38 | +// export shift_byte; |
| 39 | +// export pop_byte; |
| 40 | +// export push_byte; |
| 41 | +// export unshift_byte; |
| 42 | +// export split; |
| 43 | +// export concat; |
| 44 | +// export connect; |
45 | 45 | export to_upper;
|
46 |
| -export safe_slice; |
| 46 | +// export safe_slice; |
47 | 47 | export unsafe_from_bytes;
|
48 |
| -export is_empty; |
49 |
| -export is_not_empty; |
50 |
| -export is_whitespace; |
51 |
| -export replace; |
52 |
| -export char_slice; |
53 |
| -export trim_left; |
54 |
| -export trim_right; |
55 |
| -export trim; |
| 48 | +// export is_empty; |
| 49 | +// export is_not_empty; |
| 50 | +// export is_whitespace; |
| 51 | +// export replace; |
| 52 | +// export char_slice; |
| 53 | +// export trim_left; |
| 54 | +// export trim_right; |
| 55 | +// export trim; |
56 | 56 |
|
57 | 57 | native "rust" mod rustrt {
|
58 | 58 | type sbuf;
|
@@ -339,7 +339,7 @@ fn index(s: str, c: u8) -> int {
|
339 | 339 | }
|
340 | 340 |
|
341 | 341 | fn rindex(s: str, c: u8) -> int {
|
342 |
| - let n: int = str::byte_len(s) as int; |
| 342 | + let n: int = byte_len(s) as int; |
343 | 343 | while n >= 0 { if s[n] == c { ret n; } n -= 1; }
|
344 | 344 | ret n;
|
345 | 345 | }
|
@@ -390,15 +390,14 @@ fn slice(s: str, begin: uint, end: uint) -> str {
|
390 | 390 | // FIXME: Typestate precondition
|
391 | 391 |
|
392 | 392 | assert (begin <= end);
|
393 |
| - assert (end <= str::byte_len(s)); |
| 393 | + assert (end <= byte_len(s)); |
394 | 394 | ret rustrt::str_slice(s, begin, end);
|
395 | 395 | }
|
396 | 396 |
|
397 | 397 | fn safe_slice(s: str, begin: uint, end: uint) : le(begin, end) -> str {
|
398 |
| - assert (end <= |
399 |
| - str::byte_len(s)); // would need some magic to |
400 |
| - // make this a precondition |
401 |
| - |
| 398 | + // would need some magic to |
| 399 | + // make this a precondition |
| 400 | + assert (end <= byte_len(s)); |
402 | 401 |
|
403 | 402 | ret rustrt::str_slice(s, begin, end);
|
404 | 403 | }
|
@@ -441,7 +440,7 @@ fn split(s: str, sep: u8) -> [str] {
|
441 | 440 | ends_with_sep = true;
|
442 | 441 | } else { accum += unsafe_from_byte(c); ends_with_sep = false; }
|
443 | 442 | }
|
444 |
| - if str::byte_len(accum) != 0u || ends_with_sep { v += [accum]; } |
| 443 | + if byte_len(accum) != 0u || ends_with_sep { v += [accum]; } |
445 | 444 | ret v;
|
446 | 445 | }
|
447 | 446 |
|
|
0 commit comments