diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-10-24 06:40:35 +1100 | 
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-11-06 23:01:02 +1100 | 
| commit | 69bc4aba785e071740d2d46f109623b9951aae5d (patch) | |
| tree | c21cbc01c951ccece7ee9cbef03142811e8ccc78 /src/libsyntax/attr/mod.rs | |
| parent | e8b190ac4ad79e58d21ee1d573529ff74d8eedaa (diff) | |
| download | rust-69bc4aba785e071740d2d46f109623b9951aae5d.tar.gz rust-69bc4aba785e071740d2d46f109623b9951aae5d.zip | |
Remove unnecessary `Deref` impl for `Attribute`.
This kind of thing just makes the code harder to read.
Diffstat (limited to 'src/libsyntax/attr/mod.rs')
| -rw-r--r-- | src/libsyntax/attr/mod.rs | 10 | 
1 files changed, 5 insertions, 5 deletions
| diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs index 3e240a855e2..0c46c501be9 100644 --- a/src/libsyntax/attr/mod.rs +++ b/src/libsyntax/attr/mod.rs @@ -150,7 +150,7 @@ impl Attribute { /// /// To check the attribute name without marking it used, use the `path` field directly. pub fn check_name(&self, name: Symbol) -> bool { - let matches = self.path == name; + let matches = self.item.path == name; if matches { mark_used(self); } @@ -159,8 +159,8 @@ impl Attribute { /// For a single-segment attribute, returns its name; otherwise, returns `None`. pub fn ident(&self) -> Option<Ident> { - if self.path.segments.len() == 1 { - Some(self.path.segments[0].ident) + if self.item.path.segments.len() == 1 { + Some(self.item.path.segments[0].ident) } else { None } @@ -181,7 +181,7 @@ impl Attribute { } pub fn is_word(&self) -> bool { - self.tokens.is_empty() + self.item.tokens.is_empty() } pub fn is_meta_item_list(&self) -> bool { @@ -282,7 +282,7 @@ impl Attribute { pub fn parse_meta<'a>(&self, sess: &'a ParseSess) -> PResult<'a, MetaItem> { Ok(MetaItem { - path: self.path.clone(), + path: self.item.path.clone(), kind: parse::parse_in_attr(sess, self, |p| p.parse_meta_item_kind())?, span: self.span, }) | 
