small fix to make pragmas work

This commit is contained in:
Nikita Sivukhin
2025-09-25 20:50:16 +04:00
parent f767a2f8e7
commit 68fd940d73
2 changed files with 3 additions and 2 deletions

View File

@@ -910,7 +910,8 @@ impl Name {
pub fn as_str(&self) -> &str {
match self {
Name::Ident(s) | Name::Quoted(s) => s.as_str(),
Name::Ident(s) => s.as_str(),
Name::Quoted(s) => &s[1..s.len() - 1],
}
}

View File

@@ -1370,7 +1370,7 @@ impl ToTokens for Name {
s: &mut S,
_: &C,
) -> Result<(), S::Error> {
double_quote(self.as_str(), s)
double_quote(self.as_literal(), s)
}
}