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:
parent
ed25a674ac
commit
ee2f3d9673
18 changed files with 130 additions and 124 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue