more clippy
This commit is contained in:
parent
df72570b58
commit
7d60e3a1ad
2 changed files with 14 additions and 15 deletions
|
@ -291,7 +291,7 @@ impl<'a, T: 'a + Rewrite + ToExpr + Spanned> Context<'a, T> {
|
|||
(true, DefinitiveListTactic::Horizontal, placeholder @ Some(..)) => {
|
||||
list_items[self.items.len() - 1].item = placeholder;
|
||||
}
|
||||
_ if self.items.len() >= 1 => {
|
||||
_ if !self.items.is_empty() => {
|
||||
list_items[self.items.len() - 1].item = self
|
||||
.items
|
||||
.last()
|
||||
|
|
|
@ -626,20 +626,19 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
|
|||
ErrorKind::DeprecatedAttr,
|
||||
)],
|
||||
);
|
||||
} else if attr.path.segments[0].ident.to_string() == "rustfmt" {
|
||||
if attr.path.segments.len() == 1
|
||||
|| attr.path.segments[1].ident.to_string() != "skip"
|
||||
{
|
||||
let file_name = self.source_map.span_to_filename(attr.span).into();
|
||||
self.report.append(
|
||||
file_name,
|
||||
vec![FormattingError::from_span(
|
||||
&attr.span,
|
||||
&self.source_map,
|
||||
ErrorKind::BadAttr,
|
||||
)],
|
||||
);
|
||||
}
|
||||
} else if attr.path.segments[0].ident.to_string() == "rustfmt"
|
||||
&& (attr.path.segments.len() == 1
|
||||
|| attr.path.segments[1].ident.to_string() != "skip")
|
||||
{
|
||||
let file_name = self.source_map.span_to_filename(attr.span).into();
|
||||
self.report.append(
|
||||
file_name,
|
||||
vec![FormattingError::from_span(
|
||||
&attr.span,
|
||||
&self.source_map,
|
||||
ErrorKind::BadAttr,
|
||||
)],
|
||||
);
|
||||
}
|
||||
}
|
||||
if contains_skip(attrs) {
|
||||
|
|
Loading…
Reference in a new issue