From 899a49461a6f1c0ad6472269b50950718dc18a02 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 12 Aug 2013 13:11:01 -0700 Subject: [PATCH] More Rust version updates --- wapcaplet.rc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wapcaplet.rc b/wapcaplet.rc index 14210dd..bfa3683 100644 --- a/wapcaplet.rc +++ b/wapcaplet.rc @@ -44,7 +44,7 @@ impl Drop for LwcString { pub fn from_rust_string(s: &str) -> LwcString { unsafe { let mut interned_string = null(); - do s.as_c_str |cs| { + do s.to_c_str().with_ref |cs| { let code = lwc_intern_string(cs, s.len() as size_t, to_mut_unsafe_ptr(&mut interned_string)); @@ -98,8 +98,8 @@ impl ToStr for LwcString { fn to_str(&self) -> ~str { unsafe { // The string is located immediately after the handle - let p: *c_char = transmute(self.string.offset(1)); - str::raw::from_c_str_len(p, self.len()) + let p: *u8 = transmute(self.string.offset(1)); + str::raw::from_buf_len(p, self.len()) } } }