minor: replace panics with types

This commit is contained in:
Aleksey Kladov 2022-01-02 19:05:37 +03:00
parent 174c439c56
commit 3836b195dd
2 changed files with 15 additions and 21 deletions

View file

@ -280,7 +280,7 @@ fn convert_tokens<C: TokenConvertor>(conv: &mut C) -> tt::Subtree {
parent.subtree.token_trees.extend(entry.subtree.token_trees);
}
let subtree = stack.into_first().subtree;
let subtree = stack.into_last().subtree;
if let [tt::TokenTree::Subtree(first)] = &*subtree.token_trees {
first.clone()
} else {