We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d29e87 commit 4d788beCopy full SHA for 4d788be
src/libcore/str.rs
@@ -194,7 +194,7 @@ Function: from_cstr
194
195
Create a Rust string from a null-terminated C string
196
*/
197
-unsafe fn from_cstr(cstr: sbuf) -> str {
+fn from_cstr(cstr: sbuf) -> str unsafe {
198
let start = cstr;
199
let curr = start;
200
let i = 0u;
@@ -210,7 +210,7 @@ Function: from_cstr_len
210
211
Create a Rust string from a C string of the given length
212
213
-unsafe fn from_cstr_len(cstr: sbuf, len: uint) -> str {
+fn from_cstr_len(cstr: sbuf, len: uint) -> str unsafe {
214
let buf: [u8] = [];
215
vec::reserve(buf, len + 1u);
216
vec::as_buf(buf) {|b| ptr::memcpy(b, cstr, len); }
0 commit comments