Minor refactoring

- use `str::parse()` rather than `FromStr::from_str()`
- use `iter::once()` instead of constructing `Vec` for a single element
This commit is contained in:
Ryo Yoshida 2023-07-27 16:30:57 +09:00
parent b64e5b3919
commit 10b5fd1431
No known key found for this signature in database
GPG key ID: E25698A930586171
2 changed files with 12 additions and 11 deletions

View file

@ -65,7 +65,7 @@ pub mod token_id {
}
impl TokenTree {
pub const fn empty() -> Self {
Self::Subtree(Subtree { delimiter: Delimiter::unspecified(), token_trees: vec![] })
Self::Subtree(Subtree::empty())
}
}