Fix documentation on generated _hash methods for std::hash::Hash
[ldk-c-bindings] / c-bindings-gen / src / main.rs
index ee800dbcf49c0049a70cf9d7451ec9795a43165d..71064008755ea07d7cee59e945e267c81108cd7c 100644 (file)
@@ -1289,7 +1289,7 @@ fn writeln_impl<W: std::io::Write>(w: &mut W, w_uses: &mut HashSet<String, NonRa
 
                                                writeln!(w, " {{ true }} else {{ false }}\n}}").unwrap();
                                        } else if path_matches_nongeneric(&trait_path.1, &["core", "hash", "Hash"]) {
-                                               writeln!(w, "/// Checks if two {}s contain equal inner contents.", ident).unwrap();
+                                               writeln!(w, "/// Generates a non-cryptographic 64-bit hash of the {}.", ident).unwrap();
                                                write!(w, "#[no_mangle]\npub extern \"C\" fn {}_hash(o: &{}) -> u64 {{\n", ident, ident).unwrap();
                                                if types.c_type_has_inner_from_path(&resolved_path) {
                                                        write!(w, "\tif o.inner.is_null() {{ return 0; }}\n").unwrap();
@@ -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();