libstd: Implement `StrBuf`, a new string buffer type like `Vec`, and port all code over to use it.
Rebased & tests-fixed version of https://github.com/mozilla/rust/pull/13269
17 files changed:
sig: &ty::FnSig)
-> ~str {
let mut s = if abi == abi::Rust {
- ~""
+ StrBuf::new()
} else {
- format!("extern {} ", abi.to_str())
+ StrBuf::from_owned_str(format!("extern {} ", abi.to_str()))
};
- match purity {
- ast::ImpureFn => {}
+ match fn_style {
+ ast::NormalFn => {}
_ => {
- s.push_str(purity.to_str());
+ s.push_str(fn_style.to_str());
s.push_char(' ');
}
};