Merge pull request #1614 from birkenfeld/double_clippy

Fix clippy ignore directives
This commit is contained in:
Georg Brandl 2021-05-17 10:40:11 +02:00 committed by GitHub
commit d9beb1c11f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 9 deletions

View File

@ -95,7 +95,7 @@ where
crate::pyclass::default_new::<Self>(py, subtype) as _
}
#[allow(clippy::clippy::collapsible_if)] // for if cfg!
#[allow(clippy::collapsible_if)] // for if cfg!
unsafe fn dealloc(py: Python, self_: *mut Self::Layout) {
(*self_).py_drop(py);
let obj = PyAny::from_borrowed_ptr_or_panic(py, self_ as _);

View File

@ -70,7 +70,7 @@ pub(crate) fn gil_is_acquired() -> bool {
/// ```
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
#[allow(clippy::clippy::collapsible_if)] // for if cfg!
#[allow(clippy::collapsible_if)] // for if cfg!
pub fn prepare_freethreaded_python() {
// Protect against race conditions when Python is not yet initialized and multiple threads
// concurrently call 'prepare_freethreaded_python()'. Note that we do not protect against
@ -132,7 +132,7 @@ pub fn prepare_freethreaded_python() {
/// ```
#[cfg(not(PyPy))]
#[cfg_attr(docsrs, doc(cfg(not(PyPy))))]
#[allow(clippy::clippy::collapsible_if)] // for if cfg!
#[allow(clippy::collapsible_if)] // for if cfg!
pub unsafe fn with_embedded_python_interpreter<F, R>(f: F) -> R
where
F: for<'p> FnOnce(Python<'p>) -> R,

View File

@ -83,7 +83,7 @@ pub trait PyClassAlloc: PyTypeInfo + PyClassImpl {
///
/// # Safety
/// `self_` must be a valid pointer to the Python heap.
#[allow(clippy::clippy::collapsible_if)] // for if cfg!
#[allow(clippy::collapsible_if)] // for if cfg!
unsafe fn dealloc(py: Python, self_: *mut Self::Layout) {
(*self_).py_drop(py);
let obj = self_ as *mut ffi::PyObject;
@ -382,7 +382,7 @@ const PY_GET_SET_DEF_INIT: ffi::PyGetSetDef = ffi::PyGetSetDef {
closure: ptr::null_mut(),
};
#[allow(clippy::clippy::collapsible_if)] // for if cfg!
#[allow(clippy::collapsible_if)] // for if cfg!
fn py_class_properties(
is_dummy: bool,
for_each_method_def: &dyn Fn(&mut dyn FnMut(&PyMethodDefType)),

View File

@ -600,7 +600,7 @@ impl PyAny {
/// Returns the length of the sequence or mapping.
///
/// This is equivalent to the Python expression `len(self)`.
#[allow(clippy::clippy::len_without_is_empty)]
#[allow(clippy::len_without_is_empty)]
pub fn len(&self) -> PyResult<usize> {
let v = unsafe { ffi::PyObject_Size(self.as_ptr()) };
if v == -1 {

View File

@ -128,7 +128,7 @@ pyobject_native_type!(
);
impl PyDateTime {
#[allow(clippy::clippy::too_many_arguments)]
#[allow(clippy::too_many_arguments)]
pub fn new<'p>(
py: Python<'p>,
year: i32,
@ -159,7 +159,7 @@ impl PyDateTime {
/// Alternate constructor that takes a `fold` parameter. A `true` value for this parameter
/// signifies a leap second
#[cfg(not(PyPy))]
#[allow(clippy::clippy::too_many_arguments)]
#[allow(clippy::too_many_arguments)]
pub fn new_with_fold<'p>(
py: Python<'p>,
year: i32,

View File

@ -18,7 +18,7 @@ impl PySequence {
///
/// This is equivalent to the Python expression `len(self)`.
#[inline]
#[allow(clippy::clippy::len_without_is_empty)]
#[allow(clippy::len_without_is_empty)]
pub fn len(&self) -> PyResult<isize> {
let v = unsafe { ffi::PySequence_Size(self.as_ptr()) };
if v == -1 {