Fix some clippy lints
This commit is contained in:
parent
134c129edc
commit
6a7090c0b0
|
@ -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 {
|
||||
|
|
|
@ -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)) }
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue