Isolated bug, static vector seems to behave differently than fixed sized one
This commit is contained in:
@@ -994,7 +994,6 @@ pub fn eachi_reverse(s: &str, it: &fn(uint, u8) -> bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Iterate over each char of a string, without allocating
|
/// Iterate over each char of a string, without allocating
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn each_char(s: &str, it: &fn(char) -> bool) {
|
pub fn each_char(s: &str, it: &fn(char) -> bool) {
|
||||||
@@ -1042,35 +1041,6 @@ pub fn each_chari_reverse(s: &str, it: &fn(uint, char) -> bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// NOTE: Remove afterwards
|
|
||||||
/* /// Apply a function to each substring after splitting by character
|
|
||||||
pub fn split_char_each(ss: &str, cc: char, ff: &fn(v: &str) -> bool) {
|
|
||||||
vec::each(split_char(ss, cc), |s| ff(*s))
|
|
||||||
}
|
|
||||||
|
|
||||||
**
|
|
||||||
* Apply a function to each substring after splitting by character, up to
|
|
||||||
* `count` times
|
|
||||||
*
|
|
||||||
pub fn splitn_char_each(ss: &str, sep: char, count: uint,
|
|
||||||
ff: &fn(v: &str) -> bool) {
|
|
||||||
vec::each(splitn_char(ss, sep, count), |s| ff(*s))
|
|
||||||
}
|
|
||||||
|
|
||||||
/ Apply a function to each word
|
|
||||||
pub fn words_each(ss: &str, ff: &fn(v: &str) -> bool) {
|
|
||||||
vec::each(words(ss), |s| ff(*s))
|
|
||||||
}
|
|
||||||
|
|
||||||
**
|
|
||||||
* Apply a function to each line (by '\n')
|
|
||||||
*
|
|
||||||
pub fn lines_each(ss: &str, ff: &fn(v: &str) -> bool) {
|
|
||||||
vec::each(lines(ss), |s| ff(*s))
|
|
||||||
} */
|
|
||||||
/////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Section: Searching
|
Section: Searching
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ pub trait ToBase64 {
|
|||||||
fn to_base64(&self) -> ~str;
|
fn to_base64(&self) -> ~str;
|
||||||
}
|
}
|
||||||
|
|
||||||
static CHARS: &'static[char] = &[
|
static CHARS: [char * 64] = [
|
||||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
|
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
|
||||||
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||||
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
|
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
|
||||||
|
|||||||
Reference in New Issue
Block a user