Skip to content

Commit 979d0c9

Browse files
committed
Resolve some warnings
1 parent c337507 commit 979d0c9

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl<'a> FmtVisitor<'a> {
109109
let first_index = if has_self { 0 } else { 1 };
110110

111111
if self.config.reorder_imports {
112-
items.tail_mut().sort_by(|a, b| a.item.cmp(&b.item));
112+
items[1..].sort_by(|a, b| a.item.cmp(&b.item));
113113
}
114114

115115
let list = write_list(&items[first_index..], &fmt);

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![feature(rustc_private)]
1212
#![feature(str_escape)]
1313
#![feature(str_char)]
14-
#![feature(slice_extras)]
14+
1515

1616
// TODO we're going to allocate a whole bunch of temp Strings, is it worth
1717
// keeping some scratch mem for this and running our own StrPool?

src/types.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ impl<'a> FmtVisitor<'a> {
2626
if bound_lifetimes.len() > 0 {
2727
format!("for<{}> {}: {}",
2828
bound_lifetimes.iter().map(|l| self.rewrite_lifetime_def(l))
29-
.collect::<Vec<_>>().connect(", "),
29+
.collect::<Vec<_>>().join(", "),
3030
pprust::ty_to_string(bounded_ty),
3131
bounds.iter().map(|b| self.rewrite_ty_bound(b))
32-
.collect::<Vec<_>>().connect(" + "))
32+
.collect::<Vec<_>>().join(" + "))
3333

3434
} else {
3535
format!("{}: {}",
3636
pprust::ty_to_string(bounded_ty),
3737
bounds.iter().map(|b| self.rewrite_ty_bound(b))
38-
.collect::<Vec<_>>().connect(" + "))
38+
.collect::<Vec<_>>().join(" + "))
3939
}
4040
}
4141
&ast::WherePredicate::RegionPredicate(ast::WhereRegionPredicate{ref lifetime,
@@ -44,7 +44,7 @@ impl<'a> FmtVisitor<'a> {
4444
format!("{}: {}",
4545
pprust::lifetime_to_string(lifetime),
4646
bounds.iter().map(|l| pprust::lifetime_to_string(l))
47-
.collect::<Vec<_>>().connect(" + "))
47+
.collect::<Vec<_>>().join(" + "))
4848
}
4949
&ast::WherePredicate::EqPredicate(ast::WhereEqPredicate{ref path, ref ty, ..}) => {
5050
format!("{} = {}", pprust::path_to_string(path), pprust::ty_to_string(ty))
@@ -60,7 +60,7 @@ impl<'a> FmtVisitor<'a> {
6060
format!("{}: {}",
6161
pprust::lifetime_to_string(&lifetime.lifetime),
6262
lifetime.bounds.iter().map(|l| pprust::lifetime_to_string(l))
63-
.collect::<Vec<_>>().connect(" + "))
63+
.collect::<Vec<_>>().join(" + "))
6464
}
6565

6666
pub fn rewrite_ty_bound(&self, bound: &ast::TyParamBound) -> String {
@@ -83,7 +83,7 @@ impl<'a> FmtVisitor<'a> {
8383
if ty_param.bounds.len() > 0 {
8484
result.push_str(": ");
8585
result.push_str(&ty_param.bounds.iter().map(|b| self.rewrite_ty_bound(b))
86-
.collect::<Vec<_>>().connect(" + "));
86+
.collect::<Vec<_>>().join(" + "));
8787
}
8888
if let Some(ref def) = ty_param.default {
8989
result.push_str(" = ");
@@ -97,7 +97,7 @@ impl<'a> FmtVisitor<'a> {
9797
if t.bound_lifetimes.len() > 0 {
9898
format!("for<{}> {}",
9999
t.bound_lifetimes.iter().map(|l| self.rewrite_lifetime_def(l))
100-
.collect::<Vec<_>>().connect(", "),
100+
.collect::<Vec<_>>().join(", "),
101101
pprust::path_to_string(&t.trait_ref.path))
102102

103103
} else {

0 commit comments

Comments
 (0)