about summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src/parser.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-05-20 12:41:56 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2025-05-21 04:53:31 +1000
commite5c78de85c01e576671f9ba0c880520baf0d938d (patch)
treed12ca0ac87bbfdf4fe13ba32d8c61ff43cd44654 /compiler/rustc_attr_parsing/src/parser.rs
parent2cd2d249673b316bb4a15c10c6a1113b2bee02db (diff)
downloadrust-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.rs6
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())
     }
 }