mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Make ast_to_token_tree
infallible
It could never return `None`, so reflect that in the return type
This commit is contained in:
parent
bcf600fc88
commit
3abcdc03ba
11 changed files with 32 additions and 41 deletions
|
@ -159,8 +159,7 @@ mod tests {
|
|||
let macro_definition =
|
||||
source_file.syntax().descendants().find_map(ast::MacroRules::cast).unwrap();
|
||||
|
||||
let (definition_tt, _) =
|
||||
ast_to_token_tree(¯o_definition.token_tree().unwrap()).unwrap();
|
||||
let (definition_tt, _) = ast_to_token_tree(¯o_definition.token_tree().unwrap());
|
||||
crate::MacroRules::parse(&definition_tt).unwrap()
|
||||
}
|
||||
|
||||
|
@ -169,8 +168,7 @@ mod tests {
|
|||
let macro_invocation =
|
||||
source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap();
|
||||
|
||||
let (invocation_tt, _) =
|
||||
ast_to_token_tree(¯o_invocation.token_tree().unwrap()).unwrap();
|
||||
let (invocation_tt, _) = ast_to_token_tree(¯o_invocation.token_tree().unwrap());
|
||||
|
||||
expand_rules(&rules.rules, &invocation_tt)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue