Include a `struct` before trait return fields
authorMatt Corallo <git@bluematt.me>
Sun, 30 Jul 2023 03:36:56 +0000 (03:36 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 30 Jul 2023 03:57:15 +0000 (03:57 +0000)
EIther `struct Type` or `Type` work fine because of our type
declarations, but cbindgen uses `struct Type` everywhere so its
easiest if we match it, especially for downstream code.

genbindings.sh

index c5025982dc36a15704da88bbd69580ee1bcc2d49..f1058161f9c9cf232af1c17c40df20e57af122a8 100755 (executable)
@@ -232,7 +232,7 @@ if is_gnu_sed; then
        sed -i 's/typedef LDKnative.*Import.*LDKnative.*;//g' include/lightning.h
 
        # UnsafeCell is `repr(transparent)` so should be ignored here
-       sed -i 's/LDKUnsafeCell<\(.*\)> /\1 /g' include/lightning.h
+       sed -i 's/LDKUnsafeCell<\(.*\)> /struct \1 /g' include/lightning.h
 
        # stdlib.h doesn't exist in clang's wasm sysroot, and cbindgen
        # doesn't actually use it anyway, so drop the import.
@@ -242,7 +242,7 @@ else
        sed -i '' 's/typedef LDKnative.*Import.*LDKnative.*;//g' include/lightning.h
 
        # UnsafeCell is `repr(transparent)` so should be ignored by cbindgen
-       sed -i '' 's/LDKUnsafeCell<\(.*\)> /\1 /g' include/lightning.h
+       sed -i '' 's/LDKUnsafeCell<\(.*\)> /struct \1 /g' include/lightning.h
 
        # stdlib.h doesn't exist in clang's wasm sysroot, and cbindgen
        # doesn't actually use it anyway, so drop the import.