We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1caaa20 commit efe86a4Copy full SHA for efe86a4
crates/hir_def/src/attr.rs
@@ -195,8 +195,11 @@ impl Attr {
195
fn from_src(ast: ast::Attr, hygiene: &Hygiene) -> Option<Attr> {
196
let path = ModPath::from_src(ast.path()?, hygiene)?;
197
let input = if let Some(lit) = ast.literal() {
198
- // FIXME: escape? raw string?
199
- let value = lit.syntax().first_token()?.text().trim_matches('"').into();
+ let value = if let ast::LiteralKind::String(string) = lit.kind() {
+ string.value()?.into()
200
+ } else {
201
+ lit.syntax().first_token()?.text().trim_matches('"').into()
202
+ };
203
Some(AttrInput::Literal(value))
204
} else if let Some(tt) = ast.token_tree() {
205
Some(AttrInput::TokenTree(ast_to_token_tree(&tt)?.0))
0 commit comments