diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-05-20 12:41:56 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-05-21 04:53:31 +1000 |
| commit | e5c78de85c01e576671f9ba0c880520baf0d938d (patch) | |
| tree | d12ca0ac87bbfdf4fe13ba32d8c61ff43cd44654 /compiler/rustc_attr_parsing/src/parser.rs | |
| parent | 2cd2d249673b316bb4a15c10c6a1113b2bee02db (diff) | |
| download | rust-e5c78de85c01e576671f9ba0c880520baf0d938d.tar.gz rust-e5c78de85c01e576671f9ba0c880520baf0d938d.zip | |
Rename `MetaItemParser::path_without_args` as `MetaItemParser::path`.
And avoid the clone.
Diffstat (limited to 'compiler/rustc_attr_parsing/src/parser.rs')
| -rw-r--r-- | compiler/rustc_attr_parsing/src/parser.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_attr_parsing/src/parser.rs b/compiler/rustc_attr_parsing/src/parser.rs index 30d8aa02720..7e89f6c6a2e 100644 --- a/compiler/rustc_attr_parsing/src/parser.rs +++ b/compiler/rustc_attr_parsing/src/parser.rs @@ -258,8 +258,8 @@ impl<'a> MetaItemParser<'a> { /// - `#[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() + pub fn path(&self) -> &PathParser<'a> { + &self.path } /// Gets just the args parser, without caring about the path. @@ -274,7 +274,7 @@ impl<'a> MetaItemParser<'a> { /// - `#[rustfmt::skip]`: `rustfmt::skip` is a path, /// and not a word and should instead be parsed using [`path`](Self::path) pub fn word_is(&self, sym: Symbol) -> Option<&ArgParser<'a>> { - self.path_without_args().word_is(sym).then(|| self.args()) + self.path().word_is(sym).then(|| self.args()) } } |
