fixing indentation
This commit is contained in:
parent
ff95029171
commit
1c54744e3f
1 changed files with 29 additions and 29 deletions
|
@ -363,7 +363,7 @@ Iterate over the characters in a string
|
||||||
FIXME: A synonym to iter_chars
|
FIXME: A synonym to iter_chars
|
||||||
*/
|
*/
|
||||||
fn chars_iter(ss: str, it: fn&(char)) {
|
fn chars_iter(ss: str, it: fn&(char)) {
|
||||||
iter_chars(ss, it)
|
iter_chars(ss, it)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -374,13 +374,13 @@ Iterate over the bytes in a string
|
||||||
FIXME: Should it really include the last byte '\0'?
|
FIXME: Should it really include the last byte '\0'?
|
||||||
*/
|
*/
|
||||||
fn bytes_iter(ss: str, it: fn&(u8)) {
|
fn bytes_iter(ss: str, it: fn&(u8)) {
|
||||||
let pos = 0u;
|
let pos = 0u;
|
||||||
let len = byte_len(ss);
|
let len = byte_len(ss);
|
||||||
|
|
||||||
while (pos < len) {
|
while (pos < len) {
|
||||||
it(ss[pos]);
|
it(ss[pos]);
|
||||||
pos += 1u;
|
pos += 1u;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -920,7 +920,7 @@ Function: words_iter
|
||||||
Apply a function to each word
|
Apply a function to each word
|
||||||
*/
|
*/
|
||||||
fn words_iter(ss: str, ff: fn&(&&str)) {
|
fn words_iter(ss: str, ff: fn&(&&str)) {
|
||||||
vec::iter(words(ss), ff)
|
vec::iter(words(ss), ff)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1723,29 +1723,29 @@ mod tests {
|
||||||
assert(escape("abc\"def") == "abc\\\"def");
|
assert(escape("abc\"def") == "abc\\\"def");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_map() {
|
fn test_map() {
|
||||||
assert "" == map("", char::to_upper);
|
assert "" == map("", char::to_upper);
|
||||||
assert "YMCA" == map("ymca", char::to_upper);
|
assert "YMCA" == map("ymca", char::to_upper);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_all() {
|
fn test_all() {
|
||||||
assert true == all("", char::is_uppercase);
|
assert true == all("", char::is_uppercase);
|
||||||
assert false == all("ymca", char::is_uppercase);
|
assert false == all("ymca", char::is_uppercase);
|
||||||
assert true == all("YMCA", char::is_uppercase);
|
assert true == all("YMCA", char::is_uppercase);
|
||||||
assert false == all("yMCA", char::is_uppercase);
|
assert false == all("yMCA", char::is_uppercase);
|
||||||
assert false == all("YMCy", char::is_uppercase);
|
assert false == all("YMCy", char::is_uppercase);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_any() {
|
fn test_any() {
|
||||||
assert false == any("", char::is_uppercase);
|
assert false == any("", char::is_uppercase);
|
||||||
assert false == any("ymca", char::is_uppercase);
|
assert false == any("ymca", char::is_uppercase);
|
||||||
assert true == any("YMCA", char::is_uppercase);
|
assert true == any("YMCA", char::is_uppercase);
|
||||||
assert true == any("yMCA", char::is_uppercase);
|
assert true == any("yMCA", char::is_uppercase);
|
||||||
assert true == any("YMCy", char::is_uppercase);
|
assert true == any("YMCy", char::is_uppercase);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_windowed() {
|
fn test_windowed() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue