Skip to content

Commit 6f37acc

Browse files
committed
Rename std::str::chars to iter_chars
1 parent b0d60a7 commit 6f37acc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/lib/str.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export eq, lteq, hash, is_empty, is_not_empty, is_whitespace, byte_len, index,
1111
to_chars, char_len, char_at, bytes, is_ascii, shift_byte, pop_byte,
1212
unsafe_from_byte, unsafe_from_bytes, from_char, char_range_at,
1313
str_from_cstr, sbuf, as_buf, push_byte, utf8_char_width, safe_slice,
14-
contains, chars;
14+
contains, iter_chars;
1515

1616
native "c-stack-cdecl" mod rustrt {
1717
fn rust_str_push(&s: str, ch: u8);
@@ -300,12 +300,12 @@ Pluck a character out of a string
300300
fn char_at(s: str, i: uint) -> char { ret char_range_at(s, i).ch; }
301301

302302
/*
303-
Function: chars
303+
Function: iter_chars
304304
305305
Iterate over the characters in a string
306306
*/
307307

308-
fn chars(s: str, it: block(char)) {
308+
fn iter_chars(s: str, it: block(char)) {
309309
let pos = 0u, len = byte_len(s);
310310
while (pos < len) {
311311
let {ch, next} = char_range_at(s, pos);

src/test/stdtest/str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,9 @@ fn contains() {
317317
}
318318

319319
#[test]
320-
fn chars() {
320+
fn iter_chars() {
321321
let i = 0;
322-
str::chars("x\u03c0y") {|ch|
322+
str::iter_chars("x\u03c0y") {|ch|
323323
alt i {
324324
0 { assert ch == 'x'; }
325325
1 { assert ch == '\u03c0'; }

0 commit comments

Comments
 (0)