Created
September 15, 2013 02:09
-
-
Save MarkJr94/6567452 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn slice_from_c_str<'a>(cstr: *c_char) -> &'a str { | |
unsafe { | |
cast::transmute_region(str::raw::c_str_to_static_slice(cstr)) | |
} | |
} | |
config.rs:49 cast::transmute_region(str::raw::c_str_to_static_slice(cstr)) | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
config.rs:48:4: 50:5 error: mismatched types: expected `&'a str` but found `&<V1>` (expected &'a str but found &-ptr) | |
config.rs:48 unsafe { | |
config.rs:49 cast::transmute_region(str::raw::c_str_to_static_slice(cstr)) | |
config.rs:50 } | |
error: aborting due to 2 previous errors |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment