Merge pull request #2421 from brotzeit/clippy

apply some clippy suggestions
This commit is contained in:
Seiichi Uchida 2018-02-17 16:14:39 +09:00 committed by GitHub
commit 2bee88870f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -616,6 +616,7 @@ fn next(&mut self) -> Option<Self::Item> {
}
}
#[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 @@ pub fn visit_block(
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 @@ pub fn push_str(&mut self, s: &str) {
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);