@@ -1455,7 +1455,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1455
1455
1456
1456
fn empty_val_check_suffix_from_path ( & self , full_path : & str ) -> Option < & str > {
1457
1457
match full_path {
1458
- "lightning::ln::PaymentSecret" => Some ( ".data == [0; 32]" ) ,
1459
1458
"secp256k1::PublicKey" |"bitcoin::secp256k1::PublicKey" => Some ( ".is_null()" ) ,
1460
1459
"bitcoin::secp256k1::ecdsa::Signature" => Some ( ".is_null()" ) ,
1461
1460
_ => None
@@ -1535,11 +1534,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1535
1534
// clear for users. Thus, we default to false but override for a few
1536
1535
// types which had mappings defined when we were avoiding the `Option_`s.
1537
1536
match & resolved as & str {
1538
- "lightning::ln::PaymentSecret" => true ,
1539
- "lightning::ln::PaymentHash" => true ,
1540
- "lightning::ln::PaymentPreimage" => true ,
1541
- "lightning::ln::channelmanager::PaymentId" => true ,
1542
- "bitcoin::hash_types::BlockHash" |"bitcoin::BlockHash" => true ,
1543
1537
"secp256k1::PublicKey" |"bitcoin::secp256k1::PublicKey" => true ,
1544
1538
_ => false ,
1545
1539
}
@@ -1996,19 +1990,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
1996
1990
}
1997
1991
}
1998
1992
1999
- fn is_real_type_array ( & self , resolved_type : & str ) -> Option < syn:: Type > {
2000
- if let Some ( real_ty) = self . c_type_from_path ( & resolved_type, true , false ) {
2001
- if real_ty. ends_with ( "]" ) && real_ty. starts_with ( "*const [u8; " ) {
2002
- let mut split = real_ty. split ( "; " ) ;
2003
- split. next ( ) . unwrap ( ) ;
2004
- let tail_str = split. next ( ) . unwrap ( ) ;
2005
- assert ! ( split. next( ) . is_none( ) ) ;
2006
- let len = usize:: from_str_radix ( & tail_str[ ..tail_str. len ( ) - 1 ] , 10 ) . unwrap ( ) ;
2007
- Some ( parse_quote ! ( [ u8 ; #len] ) )
2008
- } else { None }
2009
- } else { None }
2010
- }
2011
-
2012
1993
/// Prints a suffix to determine if a variable is empty (ie was set by write_empty_rust_val).
2013
1994
/// See EmptyValExpectedTy for information on return types.
2014
1995
fn write_empty_rust_val_check_suffix < W : std:: io:: Write > ( & self , generics : Option < & GenericTypes > , w : & mut W , t : & syn:: Type ) -> EmptyValExpectedTy {
@@ -2018,9 +1999,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
2018
1999
} ,
2019
2000
syn:: Type :: Path ( p) => {
2020
2001
let resolved = self . resolve_path ( & p. path , generics) ;
2021
- if let Some ( arr_ty) = self . is_real_type_array ( & resolved) {
2022
- return self . write_empty_rust_val_check_suffix ( generics, w, & arr_ty) ;
2023
- }
2024
2002
if self . crate_types . opaques . get ( & resolved) . is_some ( ) {
2025
2003
write ! ( w, ".inner.is_null()" ) . unwrap ( ) ;
2026
2004
EmptyValExpectedTy :: NonPointer
@@ -2810,12 +2788,8 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
2810
2788
if self . c_type_has_inner_from_path( & subtype) {
2811
2789
if !self . write_c_path_intern( w, & $p_arg. path, generics, is_ref, is_mut, ptr_for_ref, false , true ) { return false ; }
2812
2790
} else {
2813
- if let Some ( arr_ty) = self . is_real_type_array( & subtype) {
2814
- if !self . write_c_type_intern( w, & arr_ty, generics, false , true , false , false , true ) { return false ; }
2815
- } else {
2816
- // Option<T> needs to be converted to a *mut T, ie mut ptr-for-ref
2817
- if !self . write_c_path_intern( w, & $p_arg. path, generics, true , true , true , false , true ) { return false ; }
2818
- }
2791
+ // Option<T> needs to be converted to a *mut T, ie mut ptr-for-ref
2792
+ if !self . write_c_path_intern( w, & $p_arg. path, generics, true , true , true , false , true ) { return false ; }
2819
2793
}
2820
2794
} else {
2821
2795
write!( w, "{}" , $p_arg. path. segments. last( ) . unwrap( ) . ident) . unwrap( ) ;
0 commit comments