more clippy
This commit is contained in:
parent
df72570b58
commit
7d60e3a1ad
@ -291,7 +291,7 @@ fn try_overflow_last_item(&self, list_items: &mut Vec<ListItem>) -> DefinitiveLi
|
||||
(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 @@ pub fn visit_attrs(&mut self, attrs: &[ast::Attribute], style: ast::AttrStyle) -
|
||||
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 New Issue
Block a user