]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/foreign-fn-linkname.rs
Add ToCStr method .with_c_str()
[rust.git] / src / test / run-pass / foreign-fn-linkname.rs
index b5a114ef22364e64dc2bea3f7ccf326b914afa50..827f950dab241ec9924c16ebd736d6fdec2de15f 100644 (file)
@@ -26,7 +26,7 @@ mod libc {
 fn strlen(str: ~str) -> uint {
     unsafe {
         // C string is terminated with a zero
-        do str.to_c_str().with_ref |buf| {
+        do str.with_c_str |buf| {
             libc::my_strlen(buf as *u8)
         }
     }