From dd7ec693a5f3d1ac81bfbdfe20c99c3ff8c5532c Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Tue, 7 Apr 2015 17:53:12 +0200 Subject: [PATCH] Remove some unnecessary transmute calls. --- ports/cef/wrappers.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ports/cef/wrappers.rs b/ports/cef/wrappers.rs index 3bfd1c27464..d955aac62b0 100644 --- a/ports/cef/wrappers.rs +++ b/ports/cef/wrappers.rs @@ -61,7 +61,7 @@ macro_rules! cef_pointer_wrapper( rust_object } unsafe fn to_rust(c_object: *const $ty) -> &'a $ty { - mem::transmute::<*const $ty,&'a $ty>(c_object) + &*c_object } } impl<'a> CefWrap<*mut $ty> for &'a mut $ty { @@ -69,7 +69,7 @@ macro_rules! cef_pointer_wrapper( rust_object } unsafe fn to_rust(c_object: *mut $ty) -> &'a mut $ty { - mem::transmute::<*mut $ty,&'a mut $ty>(c_object) + &mut *c_object } } cef_noop_wrapper!(*const $ty); @@ -214,8 +214,7 @@ impl<'a> CefWrap<*mut cef_string_t> for &'a mut [u16] { panic!("unimplemented CEF type conversion: &'a str") } unsafe fn to_rust(_: *mut cef_string_t) -> &'a mut [u16] { - mem::transmute::<(int,int),_>(panic!("unimplemented CEF type conversion: *mut \ - cef_string_t")) + panic!("unimplemented CEF type conversion: *mut cef_string_t") } }