mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-11 08:10:10 +00:00
refactor(command_parser): remove the Empty token, we don't need it
This commit is contained in:
parent
071db3d6d6
commit
92276a720e
4 changed files with 7 additions and 21 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#![feature(iter_intersperse)]
|
||||
|
||||
use command_parser::{token::Token, Tree};
|
||||
use command_parser::Tree;
|
||||
use commands::COMMAND_TREE;
|
||||
|
||||
fn main() {
|
||||
|
|
@ -32,8 +32,8 @@ fn print_tree(tree: &Tree, depth: usize) {
|
|||
print!("-");
|
||||
}
|
||||
print!("> {token:?}");
|
||||
if matches!(token, Token::Empty) {
|
||||
println!(": {}", branch.command().unwrap().cb)
|
||||
if let Some(command) = branch.command() {
|
||||
println!(": {}", command.cb)
|
||||
} else {
|
||||
print_tree(branch, depth + 1)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue