From 3681cf51e8586948aa722be4e6559168a1cca21d Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Fri, 19 Jan 2018 10:08:13 -0800 Subject: [PATCH] python2 compatibility --- CHANGES.txt | 1 + src/class/buffer.rs | 2 ++ src/python.rs | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 4058c3d8..61746a07 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -2,6 +2,7 @@ Changes ------- 0.2.4 (2018-01-19) +^^^^^^^^^^^^^^^^^^ * Allow to get mutable ref from PyObject #106 diff --git a/src/class/buffer.rs b/src/class/buffer.rs index 4ddefd88..c74aaf19 100644 --- a/src/class/buffer.rs +++ b/src/class/buffer.rs @@ -48,10 +48,12 @@ impl PyBufferProtocolImpl for T { impl<'p, T> PyBufferProtocolImpl for T where T: PyBufferProtocol<'p> { #[inline] + #[cfg_attr(feature = "cargo-clippy", allow(needless_update))] fn tp_as_buffer() -> Option { Some(ffi::PyBufferProcs{ bf_getbuffer: Self::cb_bf_getbuffer(), bf_releasebuffer: None, + .. ffi::PyBufferProcs_INIT }) } } diff --git a/src/python.rs b/src/python.rs index 38347b7d..55236633 100644 --- a/src/python.rs +++ b/src/python.rs @@ -419,7 +419,7 @@ impl<'p> Python<'p> { /// Release `ffi::PyObject` pointer. /// Undefined behavior if the pointer is invalid. #[inline] - #[cfg_attr(feature = "cargo-clippy", allow(not_unsafe_ptr_arg_deref))] + #[cfg_attr(feature = "cargo-clippy", allow(not_unsafe_ptr_arg_deref))] pub fn xdecref(self, ptr: *mut ffi::PyObject) { if !ptr.is_null() { unsafe {ffi::Py_DECREF(ptr)};