@@ -2,7 +2,7 @@ use crate::attributes::{
22 self , get_pyo3_options, CrateAttribute , DefaultAttribute , FromPyWithAttribute ,
33 RenameAllAttribute , RenamingRule ,
44} ;
5- use crate :: utils:: { self , deprecated_from_py_with , Ctx } ;
5+ use crate :: utils:: { self , Ctx } ;
66use proc_macro2:: TokenStream ;
77use quote:: { format_ident, quote, quote_spanned, ToTokens } ;
88use syn:: {
@@ -304,13 +304,10 @@ impl<'a> Container<'a> {
304304 value : expr_path,
305305 } ) = from_py_with
306306 {
307- let deprecation = deprecated_from_py_with ( expr_path) . unwrap_or_default ( ) ;
308-
309307 let extractor = quote_spanned ! { kw. span =>
310308 { let from_py_with: fn ( _) -> _ = #expr_path; from_py_with }
311309 } ;
312310 quote ! {
313- #deprecation
314311 Ok ( #self_ty {
315312 #ident: #pyo3_path:: impl_:: frompyobject:: extract_struct_field_with( #extractor, obj, #struct_name, #field_name) ?
316313 } )
@@ -327,13 +324,10 @@ impl<'a> Container<'a> {
327324 value : expr_path,
328325 } ) = from_py_with
329326 {
330- let deprecation = deprecated_from_py_with ( expr_path) . unwrap_or_default ( ) ;
331-
332327 let extractor = quote_spanned ! { kw. span =>
333328 { let from_py_with: fn ( _) -> _ = #expr_path; from_py_with }
334329 } ;
335330 quote ! {
336- #deprecation
337331 #pyo3_path:: impl_:: frompyobject:: extract_tuple_struct_field_with( #extractor, obj, #struct_name, 0 ) . map( #self_ty)
338332 }
339333 } else {
@@ -367,14 +361,7 @@ impl<'a> Container<'a> {
367361 } }
368362 } ) ;
369363
370- let deprecations = struct_fields
371- . iter ( )
372- . filter_map ( |fields| fields. from_py_with . as_ref ( ) )
373- . filter_map ( |kw| deprecated_from_py_with ( & kw. value ) )
374- . collect :: < TokenStream > ( ) ;
375-
376364 quote ! (
377- #deprecations
378365 match #pyo3_path:: types:: PyAnyMethods :: extract( obj) {
379366 :: std:: result:: Result :: Ok ( ( #( #field_idents) , * ) ) => :: std:: result:: Result :: Ok ( #self_ty( #( #fields) , * ) ) ,
380367 :: std:: result:: Result :: Err ( err) => :: std:: result:: Result :: Err ( err) ,
@@ -448,13 +435,7 @@ impl<'a> Container<'a> {
448435 fields. push ( quote ! ( #ident: #extracted) ) ;
449436 }
450437
451- let d = struct_fields
452- . iter ( )
453- . filter_map ( |field| field. from_py_with . as_ref ( ) )
454- . filter_map ( |kw| deprecated_from_py_with ( & kw. value ) )
455- . collect :: < TokenStream > ( ) ;
456-
457- quote ! ( #d :: std:: result:: Result :: Ok ( #self_ty{ #fields} ) )
438+ quote ! ( :: std:: result:: Result :: Ok ( #self_ty{ #fields} ) )
458439 }
459440}
460441
0 commit comments