Fix some clippy lints

This commit is contained in:
Alexander Niederbühl 2019-05-16 00:16:23 +02:00
parent 134c129edc
commit 6a7090c0b0
3 changed files with 3 additions and 3 deletions

View File

@ -120,7 +120,7 @@ impl<'a> FnSpec<'a> {
let ty = get_return_info(&sig.decl.output);
if fn_type == FnType::Fn && !has_self {
if arguments.len() == 0 {
if arguments.is_empty() {
panic!("Static method needs #[staticmethod] attribute");
}
let tp = match arguments.remove(0).ty {

View File

@ -28,7 +28,7 @@ pyobject_native_type!(PyFloat, ffi::PyFloat_Type, ffi::PyFloat_Check);
impl PyFloat {
/// Creates a new Python `float` object.
pub fn new<'p>(py: Python<'p>, val: c_double) -> &'p PyFloat {
pub fn new(py: Python<'_>, val: c_double) -> &PyFloat {
unsafe { py.from_owned_ptr(ffi::PyFloat_FromDouble(val)) }
}

View File

@ -96,7 +96,7 @@ impl PyBytes {
/// Creates a new Python byte string object from raw pointer.
///
/// Panics if out of memory.
pub unsafe fn from_ptr<'p>(py: Python<'p>, ptr: *const u8, len: usize) -> &'p PyBytes {
pub unsafe fn from_ptr(py: Python<'_>, ptr: *const u8, len: usize) -> &PyBytes {
py.from_owned_ptr(ffi::PyBytes_FromStringAndSize(
ptr as *const _,
len as isize,