Fix clippy lints

This commit is contained in:
Alexander Niederbühl 2020-06-05 13:53:01 +02:00
parent 468bb765bb
commit bcf48c0bd2
4 changed files with 3 additions and 2 deletions

View File

@ -114,6 +114,7 @@ fn get_delta_tuple<'p>(py: Python<'p>, delta: &PyDelta) -> &'p PyTuple {
)
}
#[allow(clippy::too_many_arguments)]
#[pyfunction]
fn make_datetime<'p>(
py: Python<'p>,

View File

@ -59,7 +59,7 @@ fn matches(word: &str, needle: &str) -> bool {
}
}
}
return needle.next().is_none();
needle.next().is_none()
}
/// Count the occurences of needle in line, case insensitive

View File

@ -613,6 +613,7 @@ mod test {
// Move obj to a thread which does not have the GIL, and clone it
let t = std::thread::spawn(move || {
// Cloning without GIL should not update reference count
#[allow(clippy::redundant_clone)]
let _ = obj.clone();
assert_eq!(count, obj.get_refcnt());

View File

@ -1,5 +1,4 @@
//! Test slf: PyRef/PyMutRef<Self>(especially, slf.into::<Py>) works
use pyo3;
use pyo3::prelude::*;
use pyo3::types::{PyBytes, PyString};
use pyo3::{AsPyRef, PyCell, PyIterProtocol};