From 9b792ce2db0ab77634a304df05b06ae3fe9c186b Mon Sep 17 00:00:00 2001 From: khollbach Date: Tue, 4 Jan 2022 12:57:12 -0500 Subject: [PATCH] Fix typo / type error in FFI code example There's a discrepancy between the C code and the Rust code that calls it. The Rust callback produces a return code: `fn(fn(int) -> int, int) -> int`, but the C callback returns nothing: `void (*)(int (*)(int), int)`. --- src/ffi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ffi.md b/src/ffi.md index 3f41187a..b52a7e99 100644 --- a/src/ffi.md +++ b/src/ffi.md @@ -709,7 +709,7 @@ fn main() { And the code on the C side looks like this: ```c -void register(void (*f)(int (*)(int), int)) { +void register(int (*f)(int (*)(int), int)) { ... } ```