diff --git a/vm/src/stdlib/itertools.rs b/vm/src/stdlib/itertools.rs index 8bc4ef797..7653ac65a 100644 --- a/vm/src/stdlib/itertools.rs +++ b/vm/src/stdlib/itertools.rs @@ -666,6 +666,7 @@ mod decl { } } + #[derive(Default)] struct GroupByState { current_value: Option, current_key: Option, @@ -729,12 +730,7 @@ mod decl { Self { iterable, key_func: key.flatten(), - state: PyMutex::new(GroupByState { - current_key: None, - current_value: None, - next_group: false, - grouper: None, - }), + state: PyMutex::new(GroupByState::default()), } .into_ref_with_type(vm, cls) .map(Into::into)