From 3abcdc03ba335fb3487c62547f61746e4a199fe6 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sun, 4 Apr 2021 01:46:45 +0200 Subject: Make `ast_to_token_tree` infallible It could never return `None`, so reflect that in the return type --- crates/hir_def/src/attr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/hir_def/src') diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs index 2bab121d9..442c5fb5b 100644 --- a/crates/hir_def/src/attr.rs +++ b/crates/hir_def/src/attr.rs @@ -533,7 +533,7 @@ impl Attr { }; Some(AttrInput::Literal(value)) } else if let Some(tt) = ast.token_tree() { - Some(AttrInput::TokenTree(ast_to_token_tree(&tt)?.0)) + Some(AttrInput::TokenTree(ast_to_token_tree(&tt).0)) } else { None }; -- cgit v1.2.3