Make ast_to_token_tree infallible

It could never return `None`, so reflect that in the return type
This commit is contained in:
Jonas Schievink 2021-04-04 01:46:45 +02:00
parent bcf600fc88
commit 3abcdc03ba
11 changed files with 32 additions and 41 deletions

View file

@ -65,7 +65,7 @@ fn macro_rules_fixtures_tt() -> FxHashMap<String, tt::Subtree> {
.filter_map(ast::MacroRules::cast)
.map(|rule| {
let id = rule.name().unwrap().to_string();
let (def_tt, _) = ast_to_token_tree(&rule.token_tree().unwrap()).unwrap();
let (def_tt, _) = ast_to_token_tree(&rule.token_tree().unwrap());
(id, def_tt)
})
.collect()