Skip to content

Commit cdbe833

Browse files
committed
[bindings] Drop manual implementations of Features conversion
We now handle features properly in our own resolution, and these appear to be self-inconsistent in some cases.
1 parent a387bad commit cdbe833

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

c-bindings-gen/src/types.rs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -666,10 +666,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
666666
// Override the default since Records contain an fmt with a lifetime:
667667
"util::logger::Record" => Some("*const std::os::raw::c_char"),
668668

669-
// List of structs we map that aren't detected:
670-
"ln::features::InitFeatures" if is_ref && ptr_for_ref => Some("crate::ln::features::InitFeatures"),
671-
"ln::features::InitFeatures" if is_ref => Some("*const crate::ln::features::InitFeatures"),
672-
"ln::features::InitFeatures" => Some("crate::ln::features::InitFeatures"),
673669
_ => None,
674670
}
675671
}
@@ -729,9 +725,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
729725
"ln::channelmanager::PaymentPreimage" if is_ref => Some("&::lightning::ln::channelmanager::PaymentPreimage(unsafe { *"),
730726
"ln::channelmanager::PaymentSecret" => Some("::lightning::ln::channelmanager::PaymentSecret("),
731727

732-
// List of structs we map (possibly during processing of other files):
733-
"ln::features::InitFeatures" if !is_ref => Some("*unsafe { Box::from_raw("),
734-
735728
// List of traits we map (possibly during processing of other files):
736729
"crate::util::logger::Logger" => Some(""),
737730

@@ -784,10 +777,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
784777
"ln::channelmanager::PaymentPreimage" if is_ref => Some(" })"),
785778
"ln::channelmanager::PaymentSecret" => Some(".data)"),
786779

787-
// List of structs we map (possibly during processing of other files):
788-
"ln::features::InitFeatures" if is_ref => Some(".inner) }"),
789-
"ln::features::InitFeatures" if !is_ref => Some(".take_inner()) }"),
790-
791780
// List of traits we map (possibly during processing of other files):
792781
"crate::util::logger::Logger" => Some(""),
793782

@@ -868,11 +857,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
868857
// Override the default since Records contain an fmt with a lifetime:
869858
"util::logger::Record" => Some("local_"),
870859

871-
// List of structs we map (possibly during processing of other files):
872-
"ln::features::InitFeatures" if is_ref && ptr_for_ref => Some("crate::ln::features::InitFeatures { inner: &mut "),
873-
"ln::features::InitFeatures" if is_ref => Some("Box::into_raw(Box::new(crate::ln::features::InitFeatures { inner: &mut "),
874-
"ln::features::InitFeatures" if !is_ref => Some("crate::ln::features::InitFeatures { inner: Box::into_raw(Box::new("),
875-
876860
_ => None,
877861
}.map(|s| s.to_owned())
878862
}
@@ -930,11 +914,6 @@ impl<'a, 'c: 'a> TypeResolver<'a, 'c> {
930914
// Override the default since Records contain an fmt with a lifetime:
931915
"util::logger::Record" => Some(".as_ptr()"),
932916

933-
// List of structs we map (possibly during processing of other files):
934-
"ln::features::InitFeatures" if is_ref && ptr_for_ref => Some(", is_owned: false }"),
935-
"ln::features::InitFeatures" if is_ref => Some(", is_owned: false }))"),
936-
"ln::features::InitFeatures" => Some(")), is_owned: true }"),
937-
938917
_ => None,
939918
}.map(|s| s.to_owned())
940919
}

0 commit comments

Comments
 (0)