Skip to content

Commit 2bee888

Browse files
authored
Merge pull request #2421 from brotzeit/clippy
apply some clippy suggestions
2 parents 4531921 + ddca0f9 commit 2bee888

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

rustfmt-core/src/lists.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ where
616616
}
617617
}
618618

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

rustfmt-core/src/visitor.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
200200

201201
let snippet = self.snippet(mk_sp(
202202
self.last_pos,
203-
attr_lo.unwrap_or(first_stmt.span.lo()),
203+
attr_lo.unwrap_or_else(|| first_stmt.span.lo()),
204204
));
205205
let len = CommentCodeSlices::new(snippet)
206206
.nth(0)
@@ -568,6 +568,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
568568
self.buffer.push_str(s);
569569
}
570570

571+
#[cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
571572
fn push_rewrite_inner(&mut self, span: Span, rewrite: Option<String>) {
572573
if let Some(ref s) = rewrite {
573574
self.push_str(s);

0 commit comments

Comments
 (0)