Fix warning in tuple.rs

This commit is contained in:
kngwyu 2019-08-18 12:57:00 +09:00
parent e752bd27f4
commit 6b67f6dead
1 changed files with 3 additions and 3 deletions

View File

@ -154,7 +154,7 @@ macro_rules! tuple_conversion ({$length:expr,$(($refN:ident, $n:tt, $T:ident)),+
fn to_object(&self, py: Python) -> PyObject { fn to_object(&self, py: Python) -> PyObject {
unsafe { unsafe {
let ptr = ffi::PyTuple_New($length); let ptr = ffi::PyTuple_New($length);
$(ffi::PyTuple_SetItem(ptr, $n, self.$n.to_object(py).into_ptr());)+; $(ffi::PyTuple_SetItem(ptr, $n, self.$n.to_object(py).into_ptr());)+
PyObject::from_owned_ptr_or_panic(py, ptr) PyObject::from_owned_ptr_or_panic(py, ptr)
} }
} }
@ -163,7 +163,7 @@ macro_rules! tuple_conversion ({$length:expr,$(($refN:ident, $n:tt, $T:ident)),+
fn into_object(self, py: Python) -> PyObject { fn into_object(self, py: Python) -> PyObject {
unsafe { unsafe {
let ptr = ffi::PyTuple_New($length); let ptr = ffi::PyTuple_New($length);
$(ffi::PyTuple_SetItem(ptr, $n, self.$n.into_object(py).into_ptr());)+; $(ffi::PyTuple_SetItem(ptr, $n, self.$n.into_object(py).into_ptr());)+
PyObject::from_owned_ptr_or_panic(py, ptr) PyObject::from_owned_ptr_or_panic(py, ptr)
} }
} }
@ -173,7 +173,7 @@ macro_rules! tuple_conversion ({$length:expr,$(($refN:ident, $n:tt, $T:ident)),+
fn into_py(self, py: Python) -> Py<PyTuple> { fn into_py(self, py: Python) -> Py<PyTuple> {
unsafe { unsafe {
let ptr = ffi::PyTuple_New($length); let ptr = ffi::PyTuple_New($length);
$(ffi::PyTuple_SetItem(ptr, $n, self.$n.into_object(py).into_ptr());)+; $(ffi::PyTuple_SetItem(ptr, $n, self.$n.into_object(py).into_ptr());)+
Py::from_owned_ptr_or_panic(ptr) Py::from_owned_ptr_or_panic(ptr)
} }
} }