Skip to content

Commit a7bd654

Browse files
committed
Use PyTupleRef in reduce return type.
1 parent a0b3c36 commit a7bd654

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stdlib/src/array.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mod array {
1313
use crate::vm::{
1414
builtins::{
1515
PyByteArray, PyBytes, PyBytesRef, PyDictRef, PyFloat, PyInt, PyIntRef, PyList,
16-
PyListRef, PySliceRef, PyStr, PyStrRef, PyTypeRef,
16+
PyListRef, PySliceRef, PyStr, PyStrRef, PyTupleRef, PyTypeRef,
1717
},
1818
class_or_notimplemented,
1919
function::{
@@ -1117,7 +1117,7 @@ mod array {
11171117
zelf: PyRef<Self>,
11181118
proto: usize,
11191119
vm: &VirtualMachine,
1120-
) -> PyResult<(PyObjectRef, PyObjectRef, Option<PyDictRef>)> {
1120+
) -> PyResult<(PyObjectRef, PyTupleRef, Option<PyDictRef>)> {
11211121
if proto < 3 {
11221122
return Self::reduce(zelf, vm);
11231123
}
@@ -1131,7 +1131,7 @@ mod array {
11311131
let func = vm.get_attribute(module, "_array_reconstructor")?;
11321132
Ok((
11331133
func,
1134-
vm.ctx.new_tuple(vec![cls, typecode, code, bytes]),
1134+
vm.new_tuple((cls, typecode, code, bytes)),
11351135
zelf.as_object().dict(),
11361136
))
11371137
}
@@ -1140,7 +1140,7 @@ mod array {
11401140
fn reduce(
11411141
zelf: PyRef<Self>,
11421142
vm: &VirtualMachine,
1143-
) -> PyResult<(PyObjectRef, PyObjectRef, Option<PyDictRef>)> {
1143+
) -> PyResult<(PyObjectRef, PyTupleRef, Option<PyDictRef>)> {
11441144
let array = zelf.read();
11451145
let cls = zelf.as_object().clone_class().into_object();
11461146
let typecode = vm.ctx.new_utf8_str(array.typecode_str());
@@ -1153,7 +1153,7 @@ mod array {
11531153
let values = vm.ctx.new_list(values);
11541154
Ok((
11551155
cls,
1156-
vm.ctx.new_tuple(vec![typecode, values]),
1156+
vm.new_tuple((typecode, values)),
11571157
zelf.as_object().dict(),
11581158
))
11591159
}

0 commit comments

Comments
 (0)