1
Fork 0

core: Remove str::init_elt

This was added based on my FIXME, but I no longer believe it has a place in
core::str, partly because it doesn't follow current naming conventions, and
partly because it can be immitated with a one liner using str::from_chars and
vec::from_elem. I have replaced the existing uses with said one-liner.
This commit is contained in:
Brian Anderson 2012-03-16 15:29:24 -07:00
parent 1680ccce1e
commit 9e9f4a6240
2 changed files with 4 additions and 15 deletions

View file

@ -20,7 +20,6 @@ export
push_char,
concat,
connect,
init_elt,
// Reinterpretation
as_bytes,
@ -241,16 +240,6 @@ fn connect(v: [str], sep: str) -> str {
ret s;
}
#[doc = "Returns a string of <n_elts> repetitions of <c>, which must be \
UTF-8"]
fn init_elt(n_elts: uint, c: char) -> str {
let mut rslt = "";
uint::range(0u, n_elts) {|_i|
push_char(rslt, c);
}
rslt
}
/*
Section: Adding to and removing from a string
*/