From 57029f6efa8cdb9b135128c9664eceaf46b922d8 Mon Sep 17 00:00:00 2001 From: Shahar Naveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Mon, 28 Jul 2025 17:55:13 +0200 Subject: [PATCH] Derive `Default` for GroupByState (#6043) --- vm/src/stdlib/itertools.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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)