Support clone for `ThreeBytes`
authorMatt Corallo <git@bluematt.me>
Sun, 12 May 2024 14:35:21 +0000 (14:35 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 12 May 2024 14:57:56 +0000 (14:57 +0000)
c-bindings-gen/src/types.rs
lightning-c-bindings/src/c_types/mod.rs

index fb884c91fc8e3db93429c945457d340aa9f67c80..6cb8061e67acc25d8449de0b1203bfae97d58eec 100644 (file)
@@ -861,6 +861,7 @@ fn initial_clonable_types() -> HashSet<String> {
        let mut res = HashSet::new();
        res.insert("crate::c_types::U5".to_owned());
        res.insert("crate::c_types::U128".to_owned());
+       res.insert("crate::c_types::ThreeBytes".to_owned());
        res.insert("crate::c_types::FourBytes".to_owned());
        res.insert("crate::c_types::TwelveBytes".to_owned());
        res.insert("crate::c_types::SixteenBytes".to_owned());
index bae1c404e5c6b6d7eeaa0e81627a13b13704f122..d4f4fafe5abd7232b1f550cf6fdf8f8c32160672 100644 (file)
@@ -774,6 +774,7 @@ pub struct ThirtyTwoBytes {
        pub data: [u8; 32],
 }
 
+#[derive(Clone)]
 #[repr(C)]
 /// A 3-byte byte array.
 pub struct ThreeBytes { /** The three bytes */ pub data: [u8; 3], }