Skip to content

Commit

Permalink
remove unnecessary inputs_iter
Browse files Browse the repository at this point in the history
  • Loading branch information
daniil-konovalenko committed Feb 18, 2021
1 parent c958aad commit e1f2c1e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions pyo3-macros-backend/src/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ impl<'a> FnSpec<'a> {
python_name: &mut Option<syn::Ident>,
) -> syn::Result<(FnType, bool)> {
let name = &sig.ident;
let mut inputs_iter = sig.inputs.iter().enumerate();
let parse_receiver = |msg: &'static str| {
let first_arg = sig
.inputs
Expand Down Expand Up @@ -260,11 +259,7 @@ impl<'a> FnSpec<'a> {
(FnType::ClassAttribute, false)
}
Some(MethodTypeAttribute::New) => (FnType::FnNew, false),
Some(MethodTypeAttribute::ClassMethod) => {
// Skip first argument for classmethod - always &PyType
let _ = inputs_iter.next();
(FnType::FnClass, true)
}
Some(MethodTypeAttribute::ClassMethod) => (FnType::FnClass, true),
Some(MethodTypeAttribute::Call) => (
FnType::FnCall(parse_receiver("expected receiver for #[call]")?),
true,
Expand Down

0 comments on commit e1f2c1e

Please sign in to comment.