diff --git a/src/debug.rs b/src/debug.rs index a883ee7..17a687e 100644 --- a/src/debug.rs +++ b/src/debug.rs @@ -16,7 +16,8 @@ mod native { } /// Prints a string. -pub fn log(msg: &str) { +pub fn log>(msg: T) { + let msg = msg.as_ref(); unsafe { native::debug_printMem(msg.as_ptr() as *const u32, msg.len() as u32) } } @@ -31,12 +32,14 @@ pub fn print64(value: u64) { } /// Prints the contents of a slice. -pub fn print_mem(slice: &[u8]) { +pub fn print_mem>(slice: T) { + let slice = slice.as_ref(); unsafe { native::debug_printMem(slice.as_ptr() as *const u32, slice.len() as u32) } } /// Prints the contents of a slice in hexadecimal format. -pub fn print_mem_hex(slice: &[u8]) { +pub fn print_mem_hex>(slice: T) { + let slice = slice.as_ref(); unsafe { native::debug_printMemHex(slice.as_ptr() as *const u32, slice.len() as u32) } }