summaryrefslogtreecommitdiffstats
path: root/src/fallback.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:40:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:40:32 +0000
commite961d207b801c7d503f809ccd407dfea3a9a3d71 (patch)
tree41e2f0eb1c4853360b6c62fd49a38e01ea9b30c6 /src/fallback.rs
parentAdding upstream version 1.0.81. (diff)
downloadrust-proc-macro2-upstream.tar.xz
rust-proc-macro2-upstream.zip
Adding upstream version 1.0.85.upstream/1.0.85upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fallback.rs')
-rw-r--r--src/fallback.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fallback.rs b/src/fallback.rs
index b42537b..2d1c991 100644
--- a/src/fallback.rs
+++ b/src/fallback.rs
@@ -781,7 +781,7 @@ impl Debug for Group {
#[derive(Clone)]
pub(crate) struct Ident {
- sym: String,
+ sym: Box<str>,
span: Span,
raw: bool,
}
@@ -795,7 +795,7 @@ impl Ident {
pub fn new_unchecked(string: &str, span: Span) -> Self {
Ident {
- sym: string.to_owned(),
+ sym: Box::from(string),
span,
raw: false,
}
@@ -809,7 +809,7 @@ impl Ident {
pub fn new_raw_unchecked(string: &str, span: Span) -> Self {
Ident {
- sym: string.to_owned(),
+ sym: Box::from(string),
span,
raw: true,
}
@@ -886,9 +886,9 @@ where
fn eq(&self, other: &T) -> bool {
let other = other.as_ref();
if self.raw {
- other.starts_with("r#") && self.sym == other[2..]
+ other.starts_with("r#") && *self.sym == other[2..]
} else {
- self.sym == other
+ *self.sym == *other
}
}
}