aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/attr.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-19 11:38:40 +0000
committerGitHub <[email protected]>2021-03-19 11:38:40 +0000
commit7200b994c9b1eeb97e80a3a64ca51ec452ab888b (patch)
tree4bde423fd1a54c34286b7b65e9b2c062ddbd3d99 /crates/hir_def/src/attr.rs
parent98d29d4f538899a8bd8caac7f4d2459438a1ae9a (diff)
parent4771a5679188177e653262e69ed7e33b4bf60c65 (diff)
Merge #8097
8097: Parse extended_key_value_attributes r=jonas-schievink a=Veykril Companion PR https://github.com/rust-analyzer/ungrammar/pull/31 Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir_def/src/attr.rs')
-rw-r--r--crates/hir_def/src/attr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs
index 1cab0e363..0360fb627 100644
--- a/crates/hir_def/src/attr.rs
+++ b/crates/hir_def/src/attr.rs
@@ -458,7 +458,7 @@ pub enum AttrInput {
458impl Attr { 458impl Attr {
459 fn from_src(ast: ast::Attr, hygiene: &Hygiene, index: u32) -> Option<Attr> { 459 fn from_src(ast: ast::Attr, hygiene: &Hygiene, index: u32) -> Option<Attr> {
460 let path = ModPath::from_src(ast.path()?, hygiene)?; 460 let path = ModPath::from_src(ast.path()?, hygiene)?;
461 let input = if let Some(lit) = ast.literal() { 461 let input = if let Some(ast::Expr::Literal(lit)) = ast.expr() {
462 let value = match lit.kind() { 462 let value = match lit.kind() {
463 ast::LiteralKind::String(string) => string.value()?.into(), 463 ast::LiteralKind::String(string) => string.value()?.into(),
464 _ => lit.syntax().first_token()?.text().trim_matches('"').into(), 464 _ => lit.syntax().first_token()?.text().trim_matches('"').into(),