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

@@ -201,7 +201,7 @@ mod tests {
let cfg_expr = {
let source_file = ast::SourceFile::parse(cfg).ok().unwrap();
let tt = source_file.syntax().descendants().find_map(ast::TokenTree::cast).unwrap();
let (tt, _) = ast_to_token_tree(&tt).unwrap();
let (tt, _) = ast_to_token_tree(&tt);
CfgExpr::parse(&tt)
};