From 1411e028c9f8cf0b93fa71f27cfdf2dfd21bf8ee Mon Sep 17 00:00:00 2001 From: Icxolu <10486322+Icxolu@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:25:54 +0100 Subject: [PATCH] fix clippy beta --- pyo3-build-config/src/impl_.rs | 2 +- pyo3-ffi/src/datetime.rs | 2 +- src/types/any.rs | 2 +- src/types/module.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pyo3-build-config/src/impl_.rs b/pyo3-build-config/src/impl_.rs index 05bb58ac7aa..f130c2d6557 100644 --- a/pyo3-build-config/src/impl_.rs +++ b/pyo3-build-config/src/impl_.rs @@ -2001,7 +2001,7 @@ fn unescape(escaped: &str) -> Vec { } } - bytes.push(unhex(chunk[0]) << 4 | unhex(chunk[1])); + bytes.push((unhex(chunk[0]) << 4) | unhex(chunk[1])); } bytes diff --git a/pyo3-ffi/src/datetime.rs b/pyo3-ffi/src/datetime.rs index e529e0fce50..7f2d7958364 100644 --- a/pyo3-ffi/src/datetime.rs +++ b/pyo3-ffi/src/datetime.rs @@ -119,7 +119,7 @@ pub struct PyDateTime_DateTime { pub unsafe fn PyDateTime_GET_YEAR(o: *mut PyObject) -> c_int { // This should work for Date or DateTime let data = (*(o as *mut PyDateTime_Date)).data; - c_int::from(data[0]) << 8 | c_int::from(data[1]) + (c_int::from(data[0]) << 8) | c_int::from(data[1]) } #[inline] diff --git a/src/types/any.rs b/src/types/any.rs index 1ebc5d40a0b..0725453e569 100644 --- a/src/types/any.rs +++ b/src/types/any.rs @@ -949,7 +949,7 @@ impl<'py> PyAnyMethods<'py> for Bound<'py, PyAny> { } } - inner(self.py(), self.getattr(attr_name).map_err(Into::into)) + inner(self.py(), self.getattr(attr_name)) } fn getattr(&self, attr_name: N) -> PyResult> diff --git a/src/types/module.rs b/src/types/module.rs index fd7299cb084..99dc1be233b 100644 --- a/src/types/module.rs +++ b/src/types/module.rs @@ -443,7 +443,7 @@ impl<'py> PyModuleMethods<'py> for Bound<'py, PyModule> { Err(err) => { if err.is_instance_of::(self.py()) { let l = PyList::empty(self.py()); - self.setattr(__all__, &l).map_err(PyErr::from)?; + self.setattr(__all__, &l)?; Ok(l) } else { Err(err)