diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-05-20 11:57:21 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-05-21 04:53:31 +1000 |
| commit | 2cd2d249673b316bb4a15c10c6a1113b2bee02db (patch) | |
| tree | 9d841d5e84d2415038c0ddbebdb072e8a9aadeeb /compiler/rustc_attr_parsing/src/parser.rs | |
| parent | ea3b3fdcc155fb0cd758392b68b1859cf9a435b4 (diff) | |
| download | rust-2cd2d249673b316bb4a15c10c6a1113b2bee02db.tar.gz rust-2cd2d249673b316bb4a15c10c6a1113b2bee02db.zip | |
Remove `MetaItemParser::{path,deconstruct}`.
They're equivalent, and `path` is unused, and `deconstruct` has only one call site outside of `path`.
Diffstat (limited to 'compiler/rustc_attr_parsing/src/parser.rs')
| -rw-r--r-- | compiler/rustc_attr_parsing/src/parser.rs | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/compiler/rustc_attr_parsing/src/parser.rs b/compiler/rustc_attr_parsing/src/parser.rs index 8366f163a68..30d8aa02720 100644 --- a/compiler/rustc_attr_parsing/src/parser.rs +++ b/compiler/rustc_attr_parsing/src/parser.rs @@ -253,7 +253,11 @@ impl<'a> MetaItemParser<'a> { } } - /// Gets just the path, without the args. + /// Gets just the path, without the args. Some examples: + /// + /// - `#[rustfmt::skip]`: `rustfmt::skip` is a path + /// - `#[allow(clippy::complexity)]`: `clippy::complexity` is a path + /// - `#[inline]`: `inline` is a single segment path pub fn path_without_args(&self) -> PathParser<'a> { self.path.clone() } @@ -263,19 +267,6 @@ impl<'a> MetaItemParser<'a> { &self.args } - pub fn deconstruct(&self) -> (PathParser<'a>, &ArgParser<'a>) { - (self.path_without_args(), self.args()) - } - - /// Asserts that this MetaItem starts with a path. Some examples: - /// - /// - `#[rustfmt::skip]`: `rustfmt::skip` is a path - /// - `#[allow(clippy::complexity)]`: `clippy::complexity` is a path - /// - `#[inline]`: `inline` is a single segment path - pub fn path(&self) -> (PathParser<'a>, &ArgParser<'a>) { - self.deconstruct() - } - /// Asserts that this MetaItem starts with a word, or single segment path. /// /// Some examples: |
