File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed
state-machines-macro/src/codegen Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -301,10 +301,9 @@ fn generate_dynamic_machine(machine: &StateMachine) -> Result<TokenStream2> {
301301 } ;
302302
303303 // Default impl only for generic context with Default bound, or concrete context with Default
304- let default_impl = if machine. context . is_some ( ) {
304+ let default_impl = if let Some ( concrete_ctx ) = & machine. context {
305305 // Concrete context: only generate Default impl if the concrete type has Default
306306 // We can't check that at macro time, so we conditionally generate with where clause
307- let concrete_ctx = machine. context . as_ref ( ) . unwrap ( ) ;
308307 quote ! {
309308 impl Default for #dynamic_name where #concrete_ctx: :: core:: default :: Default {
310309 fn default ( ) -> Self {
You can’t perform that action at this time.
0 commit comments