Skip to content

Commit e1f2c1e

Browse files
remove unnecessary inputs_iter
1 parent c958aad commit e1f2c1e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

pyo3-macros-backend/src/method.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ impl<'a> FnSpec<'a> {
230230
python_name: &mut Option<syn::Ident>,
231231
) -> syn::Result<(FnType, bool)> {
232232
let name = &sig.ident;
233-
let mut inputs_iter = sig.inputs.iter().enumerate();
234233
let parse_receiver = |msg: &'static str| {
235234
let first_arg = sig
236235
.inputs
@@ -260,11 +259,7 @@ impl<'a> FnSpec<'a> {
260259
(FnType::ClassAttribute, false)
261260
}
262261
Some(MethodTypeAttribute::New) => (FnType::FnNew, false),
263-
Some(MethodTypeAttribute::ClassMethod) => {
264-
// Skip first argument for classmethod - always &PyType
265-
let _ = inputs_iter.next();
266-
(FnType::FnClass, true)
267-
}
262+
Some(MethodTypeAttribute::ClassMethod) => (FnType::FnClass, true),
268263
Some(MethodTypeAttribute::Call) => (
269264
FnType::FnCall(parse_receiver("expected receiver for #[call]")?),
270265
true,

0 commit comments

Comments
 (0)