mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Derive Default for GroupByState (#6043)
This commit is contained in:
1 parent
d8f1d188c3
commit
57029f6efa
1 file changed
+2
-6
@@ -666,6 +666,7 @@ mod decl {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct GroupByState {
|
||||
current_value: Option<PyObjectRef>,
|
||||
current_key: Option<PyObjectRef>,
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user