Skip to content

Commit df44e50

Browse files
committed
Remove py from parse_fn_args's args(to address clippy warning)
1 parent c7e377a commit df44e50

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pyo3-derive-backend/src/pymethod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ pub fn impl_arg_params(spec: &FnSpec<'_>, body: TokenStream) -> TokenStream {
476476
// Workaround to use the question mark operator without rewriting everything
477477
let _result = (|| {
478478
let (_args, _kwargs) = pyo3::derive_utils::parse_fn_args(
479-
_py,
480479
Some(_LOCATION),
481480
PARAMS,
482481
_args,

src/derive_utils.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use crate::err::PyResult;
88
use crate::exceptions::TypeError;
99
use crate::init_once;
10+
use crate::instance::PyNativeType;
1011
use crate::types::{PyAny, PyDict, PyModule, PyTuple};
1112
use crate::GILPool;
1213
use crate::Python;
@@ -33,7 +34,6 @@ pub struct ParamDescription {
3334
/// * output: Output array that receives the arguments.
3435
/// Must have same length as `params` and must be initialized to `None`.
3536
pub fn parse_fn_args<'p>(
36-
py: Python<'p>,
3737
fname: Option<&str>,
3838
params: &[ParamDescription],
3939
args: &'p PyTuple,
@@ -99,6 +99,7 @@ pub fn parse_fn_args<'p>(
9999
}
100100
// Adjust the remaining args
101101
let args = if accept_args {
102+
let py = args.py();
102103
let slice = args.slice(used_args as isize, nargs as isize).into_py(py);
103104
py.checked_cast_as(slice).unwrap()
104105
} else {

0 commit comments

Comments
 (0)