1
Fork 0

Replace all ~"" with "".to_owned()

This commit is contained in:
Richo Healey 2014-04-15 18:17:48 -07:00 committed by Brian Anderson
parent b75683cadf
commit 919889a1d6
383 changed files with 2906 additions and 2813 deletions

View file

@ -214,7 +214,7 @@ fn path(w: &mut io::Writer, path: &clean::Path, print_all: bool,
let cache = cache.unwrap();
let abs_root = root(&**cache, loc.as_slice());
let rel_root = match path.segments.get(0).name.as_slice() {
"self" => Some(~"./"),
"self" => Some("./".to_owned()),
_ => None,
};
@ -343,7 +343,7 @@ impl fmt::Show for clean::Type {
{arrow, select, yes{ -> {ret}} other{}}",
style = FnStyleSpace(decl.fn_style),
lifetimes = if decl.lifetimes.len() == 0 {
~""
"".to_owned()
} else {
format!("<{:#}>", decl.lifetimes)
},
@ -379,13 +379,13 @@ impl fmt::Show for clean::Type {
{arrow, select, yes{ -> {ret}} other{}}",
style = FnStyleSpace(decl.fn_style),
lifetimes = if decl.lifetimes.len() == 0 {
~""
"".to_owned()
} else {
format!("<{:#}>", decl.lifetimes)
},
args = decl.decl.inputs,
bounds = if decl.bounds.len() == 0 {
~""
"".to_owned()
} else {
let mut m = decl.bounds.iter().map(|s| s.to_str());
": " + m.collect::<~[~str]>().connect(" + ")
@ -397,8 +397,8 @@ impl fmt::Show for clean::Type {
write!(f.buf, "{}{}fn{}{}",
FnStyleSpace(decl.fn_style),
match decl.abi {
ref x if "" == *x => ~"",
ref x if "\"Rust\"" == *x => ~"",
ref x if "" == *x => "".to_owned(),
ref x if "\"Rust\"" == *x => "".to_owned(),
ref s => " " + *s + " ",
},
decl.generics,
@ -432,7 +432,7 @@ impl fmt::Show for clean::Type {
}, **t)
}
clean::BorrowedRef{ lifetime: ref l, mutability, type_: ref ty} => {
let lt = match *l { Some(ref l) => format!("{} ", *l), _ => ~"" };
let lt = match *l { Some(ref l) => format!("{} ", *l), _ => "".to_owned() };
write!(f.buf, "&amp;{}{}{}",
lt,
match mutability {