rust-lang / nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
https://doc.rust-lang.org/nomicon/
Apache License 2.0
1.75k stars 258 forks source link

Fix typo / type error in FFI code example #327

Closed khollbach closed 2 years ago

khollbach commented 2 years ago

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).