mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
f
This commit is contained in:
parent
d9e52f8d96
commit
1b88888151
2 changed files with 6 additions and 9 deletions
|
@ -45,14 +45,11 @@ pub struct CommandContextBuilder<'a, S> {
|
|||
// this.range = StringRange.at(start);
|
||||
// }
|
||||
|
||||
impl<S> CommandContextBuilder<'_, S>
|
||||
where
|
||||
,
|
||||
{
|
||||
impl<S> CommandContextBuilder<'_, S> {
|
||||
pub fn new(
|
||||
dispatcher: CommandDispatcher<S>,
|
||||
source: S,
|
||||
root_node: dyn CommandNodeTrait<S>,
|
||||
root_node: &dyn CommandNodeTrait<S>,
|
||||
start: usize,
|
||||
) -> Self {
|
||||
Self {
|
||||
|
|
|
@ -21,14 +21,14 @@ enum CommandNodeEnum<'a, S> {
|
|||
Root(RootCommandNode<'a, S>),
|
||||
}
|
||||
|
||||
impl<S> Deref for CommandNodeEnum<'_, S> {
|
||||
impl<'a, S> Deref for CommandNodeEnum<'a, S> {
|
||||
type Target = dyn CommandNodeTrait<S>;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
match self {
|
||||
CommandNodeEnum::Literal(node) => node,
|
||||
CommandNodeEnum::Argument(node) => node,
|
||||
CommandNodeEnum::Root(node) => node,
|
||||
CommandNodeEnum::Literal(node) => *node as &Self::Target,
|
||||
CommandNodeEnum::Argument(node) => *node as &Self::Target,
|
||||
CommandNodeEnum::Root(node) => *node as &Self::Target,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue