From fae209419cbde416b90f3255e0e8c06008d013b2 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Tue, 7 Nov 2023 07:51:59 -0500 Subject: [PATCH] fixes #3561 -- silence new clippy warning --- newsfragments/3564.fixed.md | 1 + pyo3-macros-backend/src/method.rs | 1 + 2 files changed, 2 insertions(+) create mode 100644 newsfragments/3564.fixed.md diff --git a/newsfragments/3564.fixed.md b/newsfragments/3564.fixed.md new file mode 100644 index 00000000000..83e4dba05bb --- /dev/null +++ b/newsfragments/3564.fixed.md @@ -0,0 +1 @@ +Silenced new `clippy::unnecessary_fallible_conversions` warning when using a `Py` `self` receiver diff --git a/pyo3-macros-backend/src/method.rs b/pyo3-macros-backend/src/method.rs index d8d901bb59f..9298dab4368 100644 --- a/pyo3-macros-backend/src/method.rs +++ b/pyo3-macros-backend/src/method.rs @@ -182,6 +182,7 @@ impl SelfType { .map_err(::std::convert::Into::<_pyo3::PyErr>::into) .and_then( #[allow(clippy::useless_conversion)] // In case slf is PyCell + #[allow(unknown_lints, clippy::unnecessary_fallible_conversions)] // In case slf is Py (unknown_lints can be removed when MSRV is 1.75+) |cell| ::std::convert::TryFrom::try_from(cell).map_err(::std::convert::Into::into) )