X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=c-bindings-gen%2Fsrc%2Fblocks.rs;fp=c-bindings-gen%2Fsrc%2Fblocks.rs;h=9c32ef153918c485cab64a1943ed49361fc2bc47;hb=c4cf32b1fa04571d4a7fdadca4554c6a6d045119;hp=2bbe298189cb54f54d2bfd695ce1be04fe77cf71;hpb=11063db7153ff78d289674672099d69af0ff6a8d;p=ldk-c-bindings diff --git a/c-bindings-gen/src/blocks.rs b/c-bindings-gen/src/blocks.rs index 2bbe298..9c32ef1 100644 --- a/c-bindings-gen/src/blocks.rs +++ b/c-bindings-gen/src/blocks.rs @@ -349,6 +349,9 @@ pub fn write_option_block(w: &mut W, mangled_container: &str, writeln!(w, "\t#[allow(unused)] pub(crate) fn is_some(&self) -> bool {{").unwrap(); writeln!(w, "\t\tif let Self::Some(_) = self {{ true }} else {{ false }}").unwrap(); writeln!(w, "\t}}").unwrap(); + writeln!(w, "\t#[allow(unused)] pub(crate) fn is_none(&self) -> bool {{").unwrap(); + writeln!(w, "\t\t!self.is_some()").unwrap(); + writeln!(w, "\t}}").unwrap(); writeln!(w, "\t#[allow(unused)] pub(crate) fn take(mut self) -> {} {{", inner_type).unwrap(); writeln!(w, "\t\tif let Self::Some(v) = self {{ v }} else {{ unreachable!() }}").unwrap(); writeln!(w, "\t}}").unwrap();