Skip to content

Commit 1cd5a09

Browse files
killerswanmarijnh
authored andcommitted
(core::str) rename rindex -> rindex_chars
1 parent 969fdf4 commit 1cd5a09

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/fuzzer/fuzzer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ fn check_variants_T<T: copy>(
286286
}
287287

288288
fn last_part(filename: str) -> str {
289-
let ix = option::get(str::rindex(filename, '/'));
289+
let ix = option::get(str::rindex_chars(filename, '/'));
290290
str::slice(filename, ix + 1u, str::len_chars(filename) - 3u)
291291
}
292292

src/libcore/str.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export
7272
index_chars,
7373
byte_index,
7474
byte_index_from,
75-
rindex,
75+
rindex_chars,
7676
find,
7777
find_bytes,
7878
find_from_bytes,
@@ -877,11 +877,11 @@ fn byte_index_from(s: str, b: u8, start: uint, end: uint) -> option<uint> {
877877
str::as_bytes(s) { |v| vec::position_from(v, start, end) { |x| x == b } }
878878
}
879879

880-
// Function: rindex
880+
// Function: rindex_chars
881881
//
882882
// Returns the index of the first matching char
883883
// (as option some/none)
884-
fn rindex(ss: str, cc: char) -> option<uint> {
884+
fn rindex_chars(ss: str, cc: char) -> option<uint> {
885885
let bii = len_bytes(ss);
886886
let cii = len_chars(ss);
887887
while bii > 0u {
@@ -1546,11 +1546,11 @@ mod tests {
15461546
}
15471547

15481548
#[test]
1549-
fn test_rindex() {
1550-
assert (rindex("hello", 'l') == some(3u));
1551-
assert (rindex("hello", 'o') == some(4u));
1552-
assert (rindex("hello", 'h') == some(0u));
1553-
assert (rindex("hello", 'z') == none);
1549+
fn test_rindex_chars() {
1550+
assert (rindex_chars("hello", 'l') == some(3u));
1551+
assert (rindex_chars("hello", 'o') == some(4u));
1552+
assert (rindex_chars("hello", 'h') == some(0u));
1553+
assert (rindex_chars("hello", 'z') == none);
15541554
}
15551555

15561556
#[test]

src/libstd/fs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ type path = str;
3434

3535
fn splitDirnameBasename (pp: path) -> {dirname: str, basename: str} {
3636
let ii;
37-
alt str::rindex(pp, os_fs::path_sep) {
37+
alt str::rindex_chars(pp, os_fs::path_sep) {
3838
option::some(xx) { ii = xx; }
3939
option::none {
40-
alt str::rindex(pp, os_fs::alt_path_sep) {
40+
alt str::rindex_chars(pp, os_fs::alt_path_sep) {
4141
option::some(xx) { ii = xx; }
4242
option::none { ret {dirname: ".", basename: pp}; }
4343
}

0 commit comments

Comments
 (0)