Switched over substr and trim functions in str to be non-allocating, temporary renamed them to better track use-sites

This commit is contained in:
Marvin Löbel 2013-03-21 22:59:33 +01:00
parent ed25a674ac
commit ee2f3d9673
18 changed files with 130 additions and 124 deletions

View file

@ -311,7 +311,7 @@ mod test {
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
let doc = (desc_to_brief_pass::mk_pass().f)(srv.clone(), doc);
let doc = (sectionalize_pass::mk_pass().f)(srv.clone(), doc);
(mk_pass(~"", |s| str::trim(s) ).f)(srv.clone(), doc)
(mk_pass(~"", |s| str::trim_DBGBRWD(s).to_owned() ).f)(srv.clone(), doc)
}
}
}

View file

@ -21,7 +21,7 @@ use text_pass;
use core::str;
pub fn mk_pass() -> Pass {
text_pass::mk_pass(~"trim", |s| str::trim(s) )
text_pass::mk_pass(~"trim", |s| s.trim_DBGBRWD().to_owned() )
}
#[test]

View file

@ -78,7 +78,7 @@ fn unindent(s: &str) -> ~str {
};
if !lines.is_empty() {
let unindented = ~[lines.head().trim()]
let unindented = ~[lines.head().trim_DBGBRWD().to_owned()]
+ do lines.tail().map |line| {
if str::is_whitespace(*line) {
copy *line