]> git.bitcoin.ninja Git - ldk-c-bindings/commitdiff
Ignore discriminants on enum variants
authorMatt Corallo <git@bluematt.me>
Mon, 27 Feb 2023 21:45:29 +0000 (21:45 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 6 Mar 2023 04:20:06 +0000 (04:20 +0000)
While this loses the value information, its better than failing to
generate bindings at all.

c-bindings-gen/src/main.rs

index ee800dbcf49c0049a70cf9d7451ec9795a43165d..ffd293fe7d3c2317e4735eb5bb03f85d01f8d0d4 100644 (file)
@@ -1733,7 +1733,6 @@ fn writeln_enum<'a, 'b, W: std::io::Write>(w: &mut W, e: &'a syn::ItemEnum, type
                                write!(w, ")").unwrap();
                        }
                }
-               if var.discriminant.is_some() { unimplemented!(); }
                write!(&mut constr, ") -> {} {{\n\t{}::{}", e.ident, e.ident, var.ident).unwrap();
                if let syn::Fields::Named(fields) = &var.fields {
                        writeln!(&mut constr, " {{").unwrap();