Changed the drain into into_iter on types.rs

This commit is contained in:
David Marques
2022-04-26 07:29:36 +02:00
parent 53208182f8
commit 442e70df55

View File

@@ -267,7 +267,7 @@ impl PyType {
fn dir(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyList {
let attributes: Vec<PyObjectRef> = zelf
.get_attributes()
.drain(..)
.into_iter()
.map(|(k, _)| vm.ctx.new_str(k).into())
.collect();
PyList::from(attributes)