@@ -60,34 +60,10 @@ pub enum ResolvedTarget<const CHECKED: bool> {
60
60
) ,
61
61
}
62
62
63
- #[ derive( Clone , Debug , Default ) ]
64
- pub enum WorkflowTargetLookup {
65
- #[ default]
66
- Entrypoint ,
67
- Template {
68
- template : String ,
69
- } ,
70
- Step {
71
- template : Option < String > ,
72
- step : String ,
73
- } ,
74
- }
75
-
76
- impl WorkflowTargetLookup {
77
- fn template ( & self ) -> Option < & str > {
78
- match self {
79
- WorkflowTargetLookup :: Template { template } => Some ( & template) ,
80
- WorkflowTargetLookup :: Step { template, .. } => template. as_deref ( ) ,
81
- WorkflowTargetLookup :: Entrypoint => None ,
82
- }
83
- }
84
-
85
- fn step ( & self ) -> Option < & str > {
86
- match self {
87
- WorkflowTargetLookup :: Step { step, .. } => Some ( & step) ,
88
- _ => None ,
89
- }
90
- }
63
+ #[ derive( Clone , Debug ) ]
64
+ pub struct WorkflowTargetLookup {
65
+ template : Option < String > ,
66
+ step : Option < String > ,
91
67
}
92
68
93
69
/// A kubernetes [`Resource`], and container pair to be used based on the target we
@@ -344,18 +320,15 @@ impl ResolvedTarget<false> {
344
320
. get ( & target. workflow )
345
321
. await
346
322
. map ( |resource| {
347
- let lookup = match ( target. step . clone ( ) , target. template . clone ( ) ) {
348
- ( None , None ) => WorkflowTargetLookup :: Entrypoint ,
349
- ( None , Some ( template) ) => WorkflowTargetLookup :: Template { template } ,
350
- ( Some ( step) , template) => WorkflowTargetLookup :: Step { step, template } ,
351
- } ;
352
-
353
323
ResolvedTarget :: Workflow (
354
324
ResolvedResource {
355
325
resource,
356
326
container : target. container . clone ( ) ,
357
327
} ,
358
- lookup,
328
+ WorkflowTargetLookup {
329
+ template : target. template . clone ( ) ,
330
+ step : target. step . clone ( ) ,
331
+ } ,
359
332
)
360
333
} ) ,
361
334
Target :: Targetless => Ok ( ResolvedTarget :: Targetless (
0 commit comments