diff --git a/src/interoperability/interoperability.md b/src/interoperability/interoperability.md index cd98fd8..4b6ca65 100644 --- a/src/interoperability/interoperability.md +++ b/src/interoperability/interoperability.md @@ -19,14 +19,13 @@ to C-types that are easier and safer to handle. For `#![no_std]` environments, there is also `core::raw` that covers all the primitive types. ------------------------------------------- -| Rust type | Intermediate | C type | -|-----------|--------------|--------------| -| String | CString | *char | -| &str | CStr | *const char | -| () | c_void | void | -| u32 | u64 | c_uint | unsigned int | -| etc | ... | ... | +| Rust type | Intermediate | C type | +|------------|--------------|--------------| +| String | CString | *char | +| &str | CStr | *const char | +| () | c_void | void | +| u32 or u64 | c_uint | unsigned int | +| etc | ... | ... | As mentioned above, primitive types can be converted by the compiler implicitly. @@ -36,4 +35,4 @@ unsafe fn foo(num: u32) { let c_num: c_uint = num; let r_num: u32 = c_num; } -``` \ No newline at end of file +```