Merge pull request #3 from TheBlueMatt/main
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Wed, 10 Mar 2021 04:47:47 +0000 (04:47 +0000)
committerGitHub <noreply@github.com>
Wed, 10 Mar 2021 04:47:47 +0000 (04:47 +0000)
Fix indentation on trait `free` documentation

c-bindings-gen/src/main.rs
lightning-c-bindings/src/chain/chaininterface.rs
lightning-c-bindings/src/chain/channelmonitor.rs
lightning-c-bindings/src/chain/keysinterface.rs
lightning-c-bindings/src/chain/mod.rs
lightning-c-bindings/src/ln/msgs.rs
lightning-c-bindings/src/ln/peer_handler.rs
lightning-c-bindings/src/util/events.rs
lightning-c-bindings/src/util/logger.rs

index 9665fdc3008cc015e1c487065e03e16a93118a37..3a7bfd6c584d0d4f131ce7ea17ec2dc92487a474 100644 (file)
@@ -382,8 +382,8 @@ fn writeln_trait<'a, 'b, W: std::io::Write>(w: &mut W, t: &'a syn::ItemTrait, ty
                        });
                }
        ) );
-       writeln!(w, "/// Frees any resources associated with this object given its this_arg pointer.").unwrap();
-       writeln!(w, "/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.").unwrap();
+       writeln!(w, "\t/// Frees any resources associated with this object given its this_arg pointer.").unwrap();
+       writeln!(w, "\t/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.").unwrap();
        writeln!(w, "\tpub free: Option<extern \"C\" fn(this_arg: *mut c_void)>,").unwrap();
        generated_fields.push("free".to_owned());
        writeln!(w, "}}").unwrap();
index 3b585d323ebffe8f9c8977f54f60f025a3404582..032bd554e222a36a3f2f371854ef17c8bc7cb2f8 100644 (file)
@@ -16,8 +16,8 @@ pub struct BroadcasterInterface {
        pub this_arg: *mut c_void,
        /// Sends a transaction out to (hopefully) be mined.
        pub broadcast_transaction: extern "C" fn (this_arg: *const c_void, tx: crate::c_types::Transaction),
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 unsafe impl Sync for BroadcasterInterface {}
@@ -122,8 +122,8 @@ pub struct FeeEstimator {
        ///  * ceil(satoshis-per-kbyte / 4)
        #[must_use]
        pub get_est_sat_per_1000_weight: extern "C" fn (this_arg: *const c_void, confirmation_target: crate::chain::chaininterface::ConfirmationTarget) -> u32,
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 unsafe impl Sync for FeeEstimator {}
index ae4dc265c79c4dc15013fd245002f1c21f2a2570..67880d4f56a1277676c3117989174e47688312df 100644 (file)
@@ -723,8 +723,8 @@ pub struct Persist {
        /// [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
        #[must_use]
        pub update_persisted_channel: extern "C" fn (this_arg: *const c_void, id: crate::chain::transaction::OutPoint, update: &crate::chain::channelmonitor::ChannelMonitorUpdate, data: &crate::chain::channelmonitor::ChannelMonitor) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ,
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 unsafe impl Send for Persist {}
index c5b0324f6995f7a4e542f5082c3787dc30d1cb00..ae533b6eca2c948f4a898efa6fd5a89a44795afa 100644 (file)
@@ -591,8 +591,8 @@ pub struct Sign {
        pub clone: Option<extern "C" fn (this_arg: *const c_void) -> *mut c_void>,
        /// Serialize the object into a byte array
        pub write: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_u8Z,
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 unsafe impl Send for Sign {}
@@ -752,8 +752,8 @@ pub struct KeysInterface {
        /// you've read all of the provided bytes to ensure no corruption occurred.
        #[must_use]
        pub read_chan_signer: extern "C" fn (this_arg: *const c_void, reader: crate::c_types::u8slice) -> crate::c_types::derived::CResult_SignDecodeErrorZ,
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 unsafe impl Send for KeysInterface {}
index c3adcf6f7a6e967d9d2992f4675b23683a7b3abc..1fe25100399d79a0132376f85928be403f55dd94 100644 (file)
@@ -71,8 +71,8 @@ pub struct Access {
        /// [`short_channel_id`]: https://github.com/lightningnetwork/lightning-rfc/blob/master/07-routing-gossip.md#definition-of-short_channel_id
        #[must_use]
        pub get_utxo: extern "C" fn (this_arg: *const c_void, genesis_hash: *const [u8; 32], short_channel_id: u64) -> crate::c_types::derived::CResult_TxOutAccessErrorZ,
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 unsafe impl Send for Access {}
@@ -118,8 +118,8 @@ pub struct Listen {
        pub block_connected: extern "C" fn (this_arg: *const c_void, block: crate::c_types::u8slice, height: u32),
        /// Notifies the listener that a block was removed at the given height.
        pub block_disconnected: extern "C" fn (this_arg: *const c_void, header: *const [u8; 80], height: u32),
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 
@@ -203,8 +203,8 @@ pub struct Watch {
        /// events.
        #[must_use]
        pub release_pending_monitor_events: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_MonitorEventZ,
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 unsafe impl Send for Watch {}
@@ -279,8 +279,8 @@ pub struct Filter {
        /// Registers interest in spends of a transaction output identified by `outpoint` having
        /// `script_pubkey` as the spending condition.
        pub register_output: extern "C" fn (this_arg: *const c_void, outpoint: &crate::chain::transaction::OutPoint, script_pubkey: crate::c_types::u8slice),
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 unsafe impl Send for Filter {}
index 7089593f09a237fa1713dac693646a905509b7e9..4eb5b9d22dbd463870151486ae1ea073494c8448 100644 (file)
@@ -4490,8 +4490,8 @@ pub struct ChannelMessageHandler {
        pub handle_error: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ErrorMessage),
 /// Implementation of MessageSendEventsProvider for this object.
        pub MessageSendEventsProvider: crate::util::events::MessageSendEventsProvider,
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 impl lightning::util::events::MessageSendEventsProvider for ChannelMessageHandler {
@@ -4643,8 +4643,8 @@ pub struct RoutingMessageHandler {
        pub handle_query_short_channel_ids: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: crate::ln::msgs::QueryShortChannelIds) -> crate::c_types::derived::CResult_NoneLightningErrorZ,
 /// Implementation of MessageSendEventsProvider for this object.
        pub MessageSendEventsProvider: crate::util::events::MessageSendEventsProvider,
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 unsafe impl Send for RoutingMessageHandler {}
index 6cb11f35636f5a0a3754b3e5ae8cb8bdf307be51..9cf6baa349a8618cc522901fdd1b36cea79706df 100644 (file)
@@ -512,8 +512,8 @@ pub struct SocketDescriptor {
        /// Note that the ultimate copy of the SocketDescriptor will have all function pointers the same as the original.
        /// May be NULL if no action needs to be taken, the this_arg pointer will be copied into the new SocketDescriptor.
        pub clone: Option<extern "C" fn (this_arg: *const c_void) -> *mut c_void>,
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 impl std::cmp::Eq for SocketDescriptor {}
index 3ec8def633d01bd28e3391e92ef19697ca73019a..905360b821b8d49267bbb8f448041a8f35537e3e 100644 (file)
@@ -1019,8 +1019,8 @@ pub struct MessageSendEventsProvider {
        /// in the process.
        #[must_use]
        pub get_and_clear_pending_msg_events: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_MessageSendEventZ,
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 
@@ -1061,8 +1061,8 @@ pub struct EventsProvider {
        /// in the process.
        #[must_use]
        pub get_and_clear_pending_events: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::CVec_EventZ,
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 
index 90994504c9d678cf1cc8852b4f9f1f3750a65376..97874ddf84815c1f6e94964c59993c084501d60b 100644 (file)
@@ -95,8 +95,8 @@ pub struct Logger {
        pub this_arg: *mut c_void,
        /// Logs the `Record`
        pub log: extern "C" fn (this_arg: *const c_void, record: *const std::os::raw::c_char),
-/// Frees any resources associated with this object given its this_arg pointer.
-/// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
+       /// Frees any resources associated with this object given its this_arg pointer.
+       /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
        pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
 }
 unsafe impl Sync for Logger {}