@@ -273,7 +273,7 @@ impl Language for Python {
273273 fn write_type_alias ( & mut self , w : & mut dyn Write , ty : & RustTypeAlias ) -> std:: io:: Result < ( ) > {
274274 let r#type = self
275275 . format_type ( & ty. r#type , ty. generic_types . as_slice ( ) )
276- . map_err ( |e| std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , e ) ) ?;
276+ . map_err ( std:: io:: Error :: other ) ?;
277277
278278 writeln ! (
279279 w,
@@ -295,7 +295,7 @@ impl Language for Python {
295295 RustConstExpr :: Int ( val) => {
296296 let const_type = self
297297 . format_type ( & c. r#type , & [ ] )
298- . map_err ( |e| std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , e ) ) ?;
298+ . map_err ( std:: io:: Error :: other ) ?;
299299 writeln ! (
300300 w,
301301 "{}: {} = {}" ,
@@ -446,7 +446,7 @@ impl Python {
446446 let not_optional_but_default = !field. ty . is_optional ( ) && field. has_default ;
447447 let python_type = self
448448 . format_type ( & field. ty , generic_types)
449- . map_err ( |e| std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , e ) ) ?;
449+ . map_err ( std:: io:: Error :: other ) ?;
450450 let python_field_name = python_property_aware_rename ( & field. id . original ) ;
451451 let is_aliased = python_field_name != field. id . renamed ;
452452 let custom_translations = json_translation_for_type ( & python_type) ;
@@ -671,7 +671,7 @@ impl Python {
671671 } => {
672672 let tuple_name = self
673673 . format_type ( ty, shared. generic_types . as_slice ( ) )
674- . map_err ( |e| std:: io:: Error :: new ( std :: io :: ErrorKind :: Other , e ) ) ?;
674+ . map_err ( std:: io:: Error :: other ) ?;
675675 self . write_variant_class (
676676 & variant_class_name,
677677 tag_key,
0 commit comments