apply some clippy suggestions

This commit is contained in:
brotzeit 2018-02-14 11:05:34 +01:00
parent 418a612220
commit ddca0f9b12
2 changed files with 3 additions and 1 deletions

View file

@ -616,6 +616,7 @@ where
}
}
#[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))]
// Creates an iterator over a list's items with associated comments.
pub fn itemize_list<'a, T, I, F1, F2, F3>(
codemap: &'a CodeMap,

View file

@ -200,7 +200,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
let snippet = self.snippet(mk_sp(
self.last_pos,
attr_lo.unwrap_or(first_stmt.span.lo()),
attr_lo.unwrap_or_else(|| first_stmt.span.lo()),
));
let len = CommentCodeSlices::new(snippet)
.nth(0)
@ -568,6 +568,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
self.buffer.push_str(s);
}
#[cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
fn push_rewrite_inner(&mut self, span: Span, rewrite: Option<String>) {
if let Some(ref s) = rewrite {
self.push_str(s);