Skip to content

Commit fcc7aff

Browse files
committed
str: rm map_chars, replaced by iterators
mapping a function against the elements should not require allocating a new container, but `collect` still provides the functionality as-needed
1 parent d285ea7 commit fcc7aff

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/libstd/str.rs

-11
Original file line numberDiff line numberDiff line change
@@ -1370,8 +1370,6 @@ pub trait StrSlice<'self> {
13701370
13711371
fn slice_shift_char(&self) -> (char, &'self str);
13721372
1373-
fn map_chars(&self, ff: &fn(char) -> char) -> ~str;
1374-
13751373
fn lev_distance(&self, t: &str) -> uint;
13761374
13771375
fn subslice_offset(&self, inner: &str) -> uint;
@@ -2088,15 +2086,6 @@ impl<'self> StrSlice<'self> for &'self str {
20882086
return (ch, next_s);
20892087
}
20902088
2091-
/// Apply a function to each character.
2092-
fn map_chars(&self, ff: &fn(char) -> char) -> ~str {
2093-
let mut result = with_capacity(self.len());
2094-
for cc in self.iter() {
2095-
result.push_char(ff(cc));
2096-
}
2097-
result
2098-
}
2099-
21002089
/// Levenshtein Distance between two strings.
21012090
fn lev_distance(&self, t: &str) -> uint {
21022091
let slen = self.len();

0 commit comments

Comments
 (0)