Skip to content

Commit 5e61436

Browse files
committed
fix: clippy error
1 parent ed4c072 commit 5e61436

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

state-machines-macro/src/codegen/dynamic.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)