From 1b9763fef2627e09a4900c8d0c262b672fb93e09 Mon Sep 17 00:00:00 2001 From: mejrs Date: Wed, 23 Mar 2022 10:10:35 +0100 Subject: [PATCH] Fix merge conflict --- pyo3-macros-backend/src/attributes.rs | 8 ++++---- pyo3-macros-backend/src/pyclass.rs | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pyo3-macros-backend/src/attributes.rs b/pyo3-macros-backend/src/attributes.rs index 111e8ca8..2b63f0cf 100644 --- a/pyo3-macros-backend/src/attributes.rs +++ b/pyo3-macros-backend/src/attributes.rs @@ -42,7 +42,7 @@ pub struct KeywordAttribute { pub struct LitStrValue(pub T); impl Parse for LitStrValue { - fn parse(input: ParseStream) -> Result { + fn parse(input: ParseStream<'_>) -> Result { let lit_str: LitStr = input.parse()?; lit_str.parse().map(LitStrValue) } @@ -59,7 +59,7 @@ impl ToTokens for LitStrValue { pub struct NameLitStr(pub Ident); impl Parse for NameLitStr { - fn parse(input: ParseStream) -> Result { + fn parse(input: ParseStream<'_>) -> Result { let string_literal: LitStr = input.parse()?; if let Ok(ident) = string_literal.parse() { Ok(NameLitStr(ident)) @@ -82,7 +82,7 @@ pub type NameAttribute = KeywordAttribute; pub type TextSignatureAttribute = KeywordAttribute; impl Parse for KeywordAttribute { - fn parse(input: ParseStream) -> Result { + fn parse(input: ParseStream<'_>) -> Result { let kw: K = input.parse()?; let _: Token![=] = input.parse()?; let value = input.parse()?; @@ -152,4 +152,4 @@ pub fn take_pyo3_options(attrs: &mut Vec) -> Result Result { + fn parse(input: ParseStream<'_>, kind: PyClassKind) -> Result { Ok(PyClassArgs { class_kind: kind, options: PyClassPyO3Options::parse(input)?, @@ -39,11 +39,11 @@ impl PyClassArgs { }) } - pub fn parse_stuct_args(input: ParseStream) -> syn::Result { + pub fn parse_stuct_args(input: ParseStream<'_>) -> syn::Result { Self::parse(input, PyClassKind::Struct) } - pub fn parse_enum_args(input: ParseStream) -> syn::Result { + pub fn parse_enum_args(input: ParseStream<'_>) -> syn::Result { Self::parse(input, PyClassKind::Enum) } } @@ -80,7 +80,7 @@ enum PyClassPyO3Option { } impl Parse for PyClassPyO3Option { - fn parse(input: ParseStream) -> Result { + fn parse(input: ParseStream<'_>) -> Result { let lookahead = input.lookahead1(); if lookahead.peek(Token![crate]) { input.parse().map(PyClassPyO3Option::Crate) @@ -111,7 +111,7 @@ impl Parse for PyClassPyO3Option { } impl PyClassPyO3Options { - fn parse(input: ParseStream) -> syn::Result { + fn parse(input: ParseStream<'_>) -> syn::Result { let mut options: PyClassPyO3Options = Default::default(); for option in Punctuated::::parse_terminated(input)? { @@ -220,7 +220,7 @@ enum FieldPyO3Option { } impl Parse for FieldPyO3Option { - fn parse(input: ParseStream) -> Result { + fn parse(input: ParseStream<'_>) -> Result { let lookahead = input.lookahead1(); if lookahead.peek(attributes::kw::get) { input.parse().map(FieldPyO3Option::Get) @@ -391,7 +391,7 @@ pub fn build_py_enum( } fn impl_enum( - enum_: PyClassEnum, + enum_: PyClassEnum<'_>, args: &PyClassArgs, doc: PythonDoc, methods_type: PyClassMethodsType, @@ -401,7 +401,7 @@ fn impl_enum( } fn impl_enum_class( - enum_: PyClassEnum, + enum_: PyClassEnum<'_>, args: &PyClassArgs, doc: PythonDoc, methods_type: PyClassMethodsType, @@ -545,7 +545,7 @@ fn enum_default_slots( gen_default_items(cls, default_items).collect() } -fn extract_variant_data(variant: &syn::Variant) -> syn::Result { +fn extract_variant_data(variant: &syn::Variant) -> syn::Result> { use syn::Fields; let ident = match variant.fields { Fields::Unit => &variant.ident, @@ -925,4 +925,4 @@ fn define_inventory_class(inventory_class_name: &syn::Ident) -> TokenStream { _pyo3::inventory::collect!(#inventory_class_name); } -} \ No newline at end of file +}