From dd496223f50232fe98312ee8edc89eb4b5ee3d85 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 15 Dec 2020 19:23:51 +0100 Subject: Node-ify lifetimes --- crates/hir_expand/src/name.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'crates/hir_expand/src/name.rs') 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 { Name(Repr::TupleField(idx)) } - pub fn new_lifetime(lt: &syntax::SyntaxToken) -> Name { - assert_eq!(lt.kind(), syntax::SyntaxKind::LIFETIME); - Name(Repr::Text(lt.text().clone())) + pub fn new_lifetime(lt: &ast::Lifetime) -> Name { + Self::new_text(lt.text().clone()) } /// Shortcut to create inline plain text name -- cgit v1.2.3