Skip to content

Commit

Permalink
Fix C function FFI example in the Rust cheatsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
tbu- committed Feb 23, 2014
1 parent 8786405 commit e9bb571
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/doc/complement-cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Description C signature Equivalent
---------------------- ---------------------------------------------- ------------------------------------------
no parameters `void foo(void);` `fn foo();`
return value `int foo(void);` `fn foo() -> c_int;`
function parameters `void foo(int x, int y);` `fn foo(x: int, y: int);`
function parameters `void foo(int x, int y);` `fn foo(x: c_int, y: c_int);`
in-out pointers `void foo(const int* in_ptr, int* out_ptr);` `fn foo(in_ptr: *c_int, out_ptr: *mut c_int);`
Note: The Rust signatures should be wrapped in an `extern "ABI" { ... }` block.
Expand Down

0 comments on commit e9bb571

Please sign in to comment.