Skip to content

Commit 7d60e3a

Browse files
committed
more clippy
1 parent df72570 commit 7d60e3a

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

src/overflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ impl<'a, T: 'a + Rewrite + ToExpr + Spanned> Context<'a, T> {
291291
(true, DefinitiveListTactic::Horizontal, placeholder @ Some(..)) => {
292292
list_items[self.items.len() - 1].item = placeholder;
293293
}
294-
_ if self.items.len() >= 1 => {
294+
_ if !self.items.is_empty() => {
295295
list_items[self.items.len() - 1].item = self
296296
.items
297297
.last()

src/visitor.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -626,20 +626,19 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
626626
ErrorKind::DeprecatedAttr,
627627
)],
628628
);
629-
} else if attr.path.segments[0].ident.to_string() == "rustfmt" {
630-
if attr.path.segments.len() == 1
631-
|| attr.path.segments[1].ident.to_string() != "skip"
632-
{
633-
let file_name = self.source_map.span_to_filename(attr.span).into();
634-
self.report.append(
635-
file_name,
636-
vec![FormattingError::from_span(
637-
&attr.span,
638-
&self.source_map,
639-
ErrorKind::BadAttr,
640-
)],
641-
);
642-
}
629+
} else if attr.path.segments[0].ident.to_string() == "rustfmt"
630+
&& (attr.path.segments.len() == 1
631+
|| attr.path.segments[1].ident.to_string() != "skip")
632+
{
633+
let file_name = self.source_map.span_to_filename(attr.span).into();
634+
self.report.append(
635+
file_name,
636+
vec![FormattingError::from_span(
637+
&attr.span,
638+
&self.source_map,
639+
ErrorKind::BadAttr,
640+
)],
641+
);
643642
}
644643
}
645644
if contains_skip(attrs) {

0 commit comments

Comments
 (0)