aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_expand/src/name.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-12-16 17:08:03 +0000
committerGitHub <[email protected]>2020-12-16 17:08:03 +0000
commit067067a6c11bb5afda98f5af14bfdec4744e7812 (patch)
tree1c0b6c4c78ee040ebdf818dada804fce311382a6 /crates/hir_expand/src/name.rs
parent63bbdb31e5148c804bbf940963c9c8f3481ad258 (diff)
parentdd496223f50232fe98312ee8edc89eb4b5ee3d85 (diff)
Merge #6896
6896: Node-ify lifetimes r=jonas-schievink a=Veykril Let's see if this passes the tests 🤞 Depends on https://github.com/rust-analyzer/ungrammar/pull/15 Co-authored-by: Jonas Schievink <[email protected]> Co-authored-by: Jonas Schievink <[email protected]> Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir_expand/src/name.rs')
-rw-r--r--crates/hir_expand/src/name.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/hir_expand/src/name.rs b/crates/hir_expand/src/name.rs
index 69d8e6803..7fb4caea3 100644
--- a/crates/hir_expand/src/name.rs
+++ b/crates/hir_expand/src/name.rs
@@ -37,9 +37,8 @@ impl Name {
37 Name(Repr::TupleField(idx)) 37 Name(Repr::TupleField(idx))
38 } 38 }
39 39
40 pub fn new_lifetime(lt: &syntax::SyntaxToken) -> Name { 40 pub fn new_lifetime(lt: &ast::Lifetime) -> Name {
41 assert_eq!(lt.kind(), syntax::SyntaxKind::LIFETIME); 41 Self::new_text(lt.text().clone())
42 Name(Repr::Text(lt.text().clone()))
43 } 42 }
44 43
45 /// Shortcut to create inline plain text name 44 /// Shortcut to create inline plain text name