@@ -37,52 +37,17 @@ pub struct Planner {
3737#[ derive( Debug , Clone , thiserror:: Error ) ]
3838pub enum PlannerError {
3939 #[ error( "failed to initalize relations graph: {0}" ) ]
40- GraphInitError ( Box < GraphError > ) ,
40+ GraphInitError ( # [ from ] GraphError ) ,
4141 #[ error( "failed to locate operation to execute" ) ]
4242 MissingOperationToExecute ,
4343 #[ error( "walker failed to locate path: {0}" ) ]
44- PathLocatorError ( Box < WalkOperationError > ) ,
44+ PathLocatorError ( # [ from ] WalkOperationError ) ,
4545 #[ error( "failed to build fetch graph: {0}" ) ]
46- FailedToConstructFetchGraph ( Box < FetchGraphError > ) ,
46+ FailedToConstructFetchGraph ( # [ from ] FetchGraphError ) ,
4747 #[ error( "failed to build plan: {0}" ) ]
48- QueryPlanBuildFailed ( Box < QueryPlanError > ) ,
49- #[ error( "cancelled" ) ]
50- Cancelled ,
51- #[ error( "timedout" ) ]
52- Timedout ,
53- }
54-
55- impl From < GraphError > for PlannerError {
56- fn from ( value : GraphError ) -> Self {
57- PlannerError :: GraphInitError ( Box :: new ( value) )
58- }
59- }
60-
61- impl From < WalkOperationError > for PlannerError {
62- fn from ( value : WalkOperationError ) -> Self {
63- PlannerError :: PathLocatorError ( Box :: new ( value) )
64- }
65- }
66-
67- impl From < FetchGraphError > for PlannerError {
68- fn from ( value : FetchGraphError ) -> Self {
69- PlannerError :: FailedToConstructFetchGraph ( Box :: new ( value) )
70- }
71- }
72-
73- impl From < QueryPlanError > for PlannerError {
74- fn from ( value : QueryPlanError ) -> Self {
75- PlannerError :: QueryPlanBuildFailed ( Box :: new ( value) )
76- }
77- }
78-
79- impl From < CancellationError > for PlannerError {
80- fn from ( value : CancellationError ) -> Self {
81- match value {
82- CancellationError :: Cancelled => PlannerError :: Cancelled ,
83- CancellationError :: TimedOut => PlannerError :: Timedout ,
84- }
85- }
48+ QueryPlanBuildFailed ( #[ from] QueryPlanError ) ,
49+ #[ error( transparent) ]
50+ CancellationError ( #[ from] CancellationError ) ,
8651}
8752
8853impl Planner {
0 commit comments