11use alloc:: { boxed:: Box , string:: String , vec:: Vec } ;
22use core:: cmp:: Ordering ;
33
4- use crate :: state:: { DynamicState , EndWildcardState , StaticState , WildcardState } ;
4+ use crate :: {
5+ specificity:: Specificity ,
6+ state:: { DynamicState , EndWildcardState , StaticState , WildcardState } ,
7+ } ;
58
69mod conflict;
710mod delete;
@@ -11,7 +14,7 @@ mod insert;
1114mod optimize;
1215mod search;
1316
14- #[ derive( Clone , Debug , Eq , PartialEq ) ]
17+ #[ derive( Clone , Eq , PartialEq , Debug ) ]
1518pub struct NodeData {
1619 /// The key to the stored data.
1720 pub key : usize ,
@@ -20,11 +23,11 @@ pub struct NodeData {
2023 pub template : String ,
2124
2225 /// The specificity of the template.
23- pub specificity : usize ,
26+ pub specificity : Specificity ,
2427}
2528
2629/// Represents a node in the tree structure.
27- #[ derive( Clone , Debug , Eq , PartialEq ) ]
30+ #[ derive( Clone , Eq , PartialEq , Debug ) ]
2831pub struct Node < S > {
2932 /// The type of Node, and associated structure data.
3033 pub state : S ,
@@ -40,7 +43,7 @@ pub struct Node<S> {
4043 pub end_wildcard : Option < Box < Node < EndWildcardState > > > ,
4144
4245 /// Flag indicating whether this node need optimization.
43- /// During optimization, the shortcut flags are updated, and nodes sorted.
46+ /// During optimization, the shortcut flags are updated, specificity calculated, and nodes sorted.
4447 pub needs_optimization : bool ,
4548}
4649
0 commit comments