]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/ptr.rs
auto merge of #8532 : kballard/rust/cstr-cleanup, r=erickt
[rust.git] / src / libstd / ptr.rs
index 50c25a2f722f841d322a5e8557ceb7597f46c17e..de8f8c69e8432e25cd4137f9eae6007c3e59b561 100644 (file)
@@ -482,7 +482,7 @@ struct Pair {
     fn test_position() {
         use libc::c_char;
 
-        do "hello".to_c_str().with_ref |p| {
+        do "hello".with_c_str |p| {
             unsafe {
                 assert!(2u == position(p, |c| *c == 'l' as c_char));
                 assert!(4u == position(p, |c| *c == 'o' as c_char));
@@ -493,9 +493,9 @@ fn test_position() {
 
     #[test]
     fn test_buf_len() {
-        do "hello".to_c_str().with_ref |p0| {
-            do "there".to_c_str().with_ref |p1| {
-                do "thing".to_c_str().with_ref |p2| {
+        do "hello".with_c_str |p0| {
+            do "there".with_c_str |p1| {
+                do "thing".with_c_str |p2| {
                     let v = ~[p0, p1, p2, null()];
                     do v.as_imm_buf |vp, len| {
                         assert_eq!(unsafe { buf_len(vp) }, 3u);