diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-08-11 21:06:11 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-08-16 11:10:13 +1000 |
| commit | 85a6cd6a47ea0f7129dff5038fce7398ceb18222 (patch) | |
| tree | 8bf1f879e45dbbbc1437f3790c34be1390ec63e0 /src/tools/rustfmt | |
| parent | 40336865fe7d4a01139a3336639c6971647e885c (diff) | |
| download | rust-85a6cd6a47ea0f7129dff5038fce7398ceb18222.tar.gz rust-85a6cd6a47ea0f7129dff5038fce7398ceb18222.zip | |
Shrink `ast::Attribute`.
Diffstat (limited to 'src/tools/rustfmt')
| -rw-r--r-- | src/tools/rustfmt/src/skip.rs | 4 | ||||
| -rw-r--r-- | src/tools/rustfmt/src/visitor.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/rustfmt/src/skip.rs b/src/tools/rustfmt/src/skip.rs index 0fdc097efc2..032922d421d 100644 --- a/src/tools/rustfmt/src/skip.rs +++ b/src/tools/rustfmt/src/skip.rs @@ -58,8 +58,8 @@ fn get_skip_names(kind: &str, attrs: &[ast::Attribute]) -> Vec<String> { for attr in attrs { // rustc_ast::ast::Path is implemented partialEq // but it is designed for segments.len() == 1 - if let ast::AttrKind::Normal(attr_item, _) = &attr.kind { - if pprust::path_to_string(&attr_item.path) != path { + if let ast::AttrKind::Normal(normal) = &attr.kind { + if pprust::path_to_string(&normal.item.path) != path { continue; } } diff --git a/src/tools/rustfmt/src/visitor.rs b/src/tools/rustfmt/src/visitor.rs index 9a0e0752c12..7bb745eeb8b 100644 --- a/src/tools/rustfmt/src/visitor.rs +++ b/src/tools/rustfmt/src/visitor.rs @@ -811,8 +811,8 @@ impl<'b, 'a: 'b> FmtVisitor<'a> { ); } else { match &attr.kind { - ast::AttrKind::Normal(ref attribute_item, _) - if self.is_unknown_rustfmt_attr(&attribute_item.path.segments) => + ast::AttrKind::Normal(ref normal) + if self.is_unknown_rustfmt_attr(&normal.item.path.segments) => { let file_name = self.parse_sess.span_to_filename(attr.span); self.report.append( |
