Resolve some warnings
This commit is contained in:
parent
c3375078e5
commit
979d0c9756
@ -109,7 +109,7 @@ impl<'a> FmtVisitor<'a> {
|
||||
let first_index = if has_self { 0 } else { 1 };
|
||||
|
||||
if self.config.reorder_imports {
|
||||
items.tail_mut().sort_by(|a, b| a.item.cmp(&b.item));
|
||||
items[1..].sort_by(|a, b| a.item.cmp(&b.item));
|
||||
}
|
||||
|
||||
let list = write_list(&items[first_index..], &fmt);
|
||||
|
@ -11,7 +11,7 @@
|
||||
#![feature(rustc_private)]
|
||||
#![feature(str_escape)]
|
||||
#![feature(str_char)]
|
||||
#![feature(slice_extras)]
|
||||
|
||||
|
||||
// TODO we're going to allocate a whole bunch of temp Strings, is it worth
|
||||
// keeping some scratch mem for this and running our own StrPool?
|
||||
|
14
src/types.rs
14
src/types.rs
@ -26,16 +26,16 @@ impl<'a> FmtVisitor<'a> {
|
||||
if bound_lifetimes.len() > 0 {
|
||||
format!("for<{}> {}: {}",
|
||||
bound_lifetimes.iter().map(|l| self.rewrite_lifetime_def(l))
|
||||
.collect::<Vec<_>>().connect(", "),
|
||||
.collect::<Vec<_>>().join(", "),
|
||||
pprust::ty_to_string(bounded_ty),
|
||||
bounds.iter().map(|b| self.rewrite_ty_bound(b))
|
||||
.collect::<Vec<_>>().connect(" + "))
|
||||
.collect::<Vec<_>>().join(" + "))
|
||||
|
||||
} else {
|
||||
format!("{}: {}",
|
||||
pprust::ty_to_string(bounded_ty),
|
||||
bounds.iter().map(|b| self.rewrite_ty_bound(b))
|
||||
.collect::<Vec<_>>().connect(" + "))
|
||||
.collect::<Vec<_>>().join(" + "))
|
||||
}
|
||||
}
|
||||
&ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate{ref lifetime,
|
||||
@ -44,7 +44,7 @@ impl<'a> FmtVisitor<'a> {
|
||||
format!("{}: {}",
|
||||
pprust::lifetime_to_string(lifetime),
|
||||
bounds.iter().map(|l| pprust::lifetime_to_string(l))
|
||||
.collect::<Vec<_>>().connect(" + "))
|
||||
.collect::<Vec<_>>().join(" + "))
|
||||
}
|
||||
&ast::WherePredicate::EqPredicate(ast::WhereEqPredicate{ref path, ref ty, ..}) => {
|
||||
format!("{} = {}", pprust::path_to_string(path), pprust::ty_to_string(ty))
|
||||
@ -60,7 +60,7 @@ impl<'a> FmtVisitor<'a> {
|
||||
format!("{}: {}",
|
||||
pprust::lifetime_to_string(&lifetime.lifetime),
|
||||
lifetime.bounds.iter().map(|l| pprust::lifetime_to_string(l))
|
||||
.collect::<Vec<_>>().connect(" + "))
|
||||
.collect::<Vec<_>>().join(" + "))
|
||||
}
|
||||
|
||||
pub fn rewrite_ty_bound(&self, bound: &ast::TyParamBound) -> String {
|
||||
@ -83,7 +83,7 @@ impl<'a> FmtVisitor<'a> {
|
||||
if ty_param.bounds.len() > 0 {
|
||||
result.push_str(": ");
|
||||
result.push_str(&ty_param.bounds.iter().map(|b| self.rewrite_ty_bound(b))
|
||||
.collect::<Vec<_>>().connect(" + "));
|
||||
.collect::<Vec<_>>().join(" + "));
|
||||
}
|
||||
if let Some(ref def) = ty_param.default {
|
||||
result.push_str(" = ");
|
||||
@ -97,7 +97,7 @@ impl<'a> FmtVisitor<'a> {
|
||||
if t.bound_lifetimes.len() > 0 {
|
||||
format!("for<{}> {}",
|
||||
t.bound_lifetimes.iter().map(|l| self.rewrite_lifetime_def(l))
|
||||
.collect::<Vec<_>>().connect(", "),
|
||||
.collect::<Vec<_>>().join(", "),
|
||||
pprust::path_to_string(&t.trait_ref.path))
|
||||
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user