Fix some Clippy warnings only visible in the CI.
This commit is contained in:
parent
f981fded3f
commit
2c1762949e
|
@ -402,12 +402,12 @@ impl<'a> FunctionSignature<'a> {
|
||||||
SignatureItem::Varargs(varargs) => {
|
SignatureItem::Varargs(varargs) => {
|
||||||
let fn_arg = next_non_py_argument_checked(&varargs.ident)?;
|
let fn_arg = next_non_py_argument_checked(&varargs.ident)?;
|
||||||
fn_arg.is_varargs = true;
|
fn_arg.is_varargs = true;
|
||||||
parse_state.add_varargs(&mut python_signature, &varargs)?;
|
parse_state.add_varargs(&mut python_signature, varargs)?;
|
||||||
}
|
}
|
||||||
SignatureItem::Kwargs(kwargs) => {
|
SignatureItem::Kwargs(kwargs) => {
|
||||||
let fn_arg = next_non_py_argument_checked(&kwargs.ident)?;
|
let fn_arg = next_non_py_argument_checked(&kwargs.ident)?;
|
||||||
fn_arg.is_kwargs = true;
|
fn_arg.is_kwargs = true;
|
||||||
parse_state.add_kwargs(&mut python_signature, &kwargs)?;
|
parse_state.add_kwargs(&mut python_signature, kwargs)?;
|
||||||
}
|
}
|
||||||
SignatureItem::PosargsSep(sep) => {
|
SignatureItem::PosargsSep(sep) => {
|
||||||
parse_state.finish_pos_only_args(&mut python_signature, sep.span())?
|
parse_state.finish_pos_only_args(&mut python_signature, sep.span())?
|
||||||
|
|
|
@ -207,7 +207,7 @@ pub fn gen_py_method(
|
||||||
GeneratedPyMethod::Proto(impl_call_slot(cls, method.spec)?)
|
GeneratedPyMethod::Proto(impl_call_slot(cls, method.spec)?)
|
||||||
}
|
}
|
||||||
PyMethodProtoKind::Traverse => {
|
PyMethodProtoKind::Traverse => {
|
||||||
GeneratedPyMethod::Proto(impl_traverse_slot(cls, &spec.name))
|
GeneratedPyMethod::Proto(impl_traverse_slot(cls, spec.name))
|
||||||
}
|
}
|
||||||
PyMethodProtoKind::SlotFragment(slot_fragment_def) => {
|
PyMethodProtoKind::SlotFragment(slot_fragment_def) => {
|
||||||
let proto = slot_fragment_def.generate_pyproto_fragment(cls, spec)?;
|
let proto = slot_fragment_def.generate_pyproto_fragment(cls, spec)?;
|
||||||
|
@ -219,19 +219,19 @@ pub fn gen_py_method(
|
||||||
(_, FnType::Fn(_)) => GeneratedPyMethod::Method(impl_py_method_def(
|
(_, FnType::Fn(_)) => GeneratedPyMethod::Method(impl_py_method_def(
|
||||||
cls,
|
cls,
|
||||||
spec,
|
spec,
|
||||||
&create_doc(meth_attrs, &spec),
|
&create_doc(meth_attrs, spec),
|
||||||
None,
|
None,
|
||||||
)?),
|
)?),
|
||||||
(_, FnType::FnClass) => GeneratedPyMethod::Method(impl_py_method_def(
|
(_, FnType::FnClass) => GeneratedPyMethod::Method(impl_py_method_def(
|
||||||
cls,
|
cls,
|
||||||
spec,
|
spec,
|
||||||
&create_doc(meth_attrs, &spec),
|
&create_doc(meth_attrs, spec),
|
||||||
Some(quote!(_pyo3::ffi::METH_CLASS)),
|
Some(quote!(_pyo3::ffi::METH_CLASS)),
|
||||||
)?),
|
)?),
|
||||||
(_, FnType::FnStatic) => GeneratedPyMethod::Method(impl_py_method_def(
|
(_, FnType::FnStatic) => GeneratedPyMethod::Method(impl_py_method_def(
|
||||||
cls,
|
cls,
|
||||||
spec,
|
spec,
|
||||||
&create_doc(meth_attrs, &spec),
|
&create_doc(meth_attrs, spec),
|
||||||
Some(quote!(_pyo3::ffi::METH_STATIC)),
|
Some(quote!(_pyo3::ffi::METH_STATIC)),
|
||||||
)?),
|
)?),
|
||||||
// special prototypes
|
// special prototypes
|
||||||
|
@ -242,7 +242,7 @@ pub fn gen_py_method(
|
||||||
PropertyType::Function {
|
PropertyType::Function {
|
||||||
self_type,
|
self_type,
|
||||||
spec,
|
spec,
|
||||||
doc: create_doc(meth_attrs, &spec),
|
doc: create_doc(meth_attrs, spec),
|
||||||
},
|
},
|
||||||
)?),
|
)?),
|
||||||
(_, FnType::Setter(self_type)) => GeneratedPyMethod::Method(impl_py_setter_def(
|
(_, FnType::Setter(self_type)) => GeneratedPyMethod::Method(impl_py_setter_def(
|
||||||
|
@ -250,7 +250,7 @@ pub fn gen_py_method(
|
||||||
PropertyType::Function {
|
PropertyType::Function {
|
||||||
self_type,
|
self_type,
|
||||||
spec,
|
spec,
|
||||||
doc: create_doc(meth_attrs, &spec),
|
doc: create_doc(meth_attrs, spec),
|
||||||
},
|
},
|
||||||
)?),
|
)?),
|
||||||
(_, FnType::FnModule) => {
|
(_, FnType::FnModule) => {
|
||||||
|
@ -794,7 +794,7 @@ impl PropertyType<'_> {
|
||||||
PropertyType::Descriptor { field, .. } => {
|
PropertyType::Descriptor { field, .. } => {
|
||||||
Cow::Owned(utils::get_doc(&field.attrs, None))
|
Cow::Owned(utils::get_doc(&field.attrs, None))
|
||||||
}
|
}
|
||||||
PropertyType::Function { doc, .. } => Cow::Borrowed(&doc),
|
PropertyType::Function { doc, .. } => Cow::Borrowed(doc),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue