projects
/
ldk-c-bindings
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6715f52
)
Fix documentation on generated _hash methods for std::hash::Hash
author
Matt Corallo
<git@bluematt.me>
Mon, 17 Apr 2023 17:42:40 +0000
(17:42 +0000)
committer
Matt Corallo
<git@bluematt.me>
Mon, 17 Apr 2023 17:42:40 +0000
(17:42 +0000)
c-bindings-gen/src/main.rs
patch
|
blob
|
history
diff --git
a/c-bindings-gen/src/main.rs
b/c-bindings-gen/src/main.rs
index ffd293fe7d3c2317e4735eb5bb03f85d01f8d0d4..71064008755ea07d7cee59e945e267c81108cd7c 100644
(file)
--- a/
c-bindings-gen/src/main.rs
+++ b/
c-bindings-gen/src/main.rs
@@
-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, " {{ 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();
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();