We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clippy complains about a useless conversion to PyErr for functions returning PyResult<[anything]> on the latest nightly toolchain.
Example function:
#[pyfunction] #[pyo3(name = "set_cvar_limit")] #[pyo3(signature = (cvar, value, min, max, flags=None))] pub(crate) fn pyshinqlx_set_cvar_limit( py: Python<'_>, cvar: &str, value: &str, min: &str, max: &str, flags: Option<i32>, ) -> PyResult<()> { py.allow_threads(|| { MAIN_ENGINE.load().as_ref().map_or( Err(PyEnvironmentError::new_err( "main quake live engine not set", )), |main_engine| { main_engine.set_cvar_limit(cvar, value, min, max, flags); Ok(()) }, ) }) }
error: useless conversion to the same type: `pyo3::PyErr` --> src\ffi\python\embed\set_cvar_limit.rs:17:18 | 17 | ) -> PyResult<()> { | ^ | | | help: consider removing | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
Windows 11, Linux, MacOS
python --version
3.11.9
rustc --version
1.85 nightly
0.23.3
uv, venv
No response
The text was updated successfully, but these errors were encountered:
same issue
#[allow(clippy::useless_conversion)] on the function before the #[pyfunction] doesn't work
#![allow(clippy::useless_conversion)] on the whole module does silence the warnings
problem is, that makes it harder to find other useless conversions!
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Bug Description
Clippy complains about a useless conversion to PyErr for functions returning PyResult<[anything]> on the latest nightly toolchain.
Steps to Reproduce
Example function:
Backtrace
Your operating system and version
Windows 11, Linux, MacOS
Your Python version (
python --version
)3.11.9
Your Rust version (
rustc --version
)1.85 nightly
Your PyO3 version
0.23.3
How did you install python? Did you use a virtualenv?
uv, venv
Additional Info
No response
The text was updated successfully, but these errors were encountered: