mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Derive Default for GroupByState (#6043)
This commit is contained in:
@@ -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