diff options
author | Ms2ger <ms2ger@gmail.com> | 2015-02-13 11:42:13 +0100 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2015-02-13 11:42:13 +0100 |
commit | 830e6741c76a5eef85096d0378484d62f70c911a (patch) | |
tree | 5bb71d7f842bcceaabb44878724b027123f4e224 /components/util/debug_utils.rs | |
parent | b25564440ddeab1fdcb3dec2b069130759bc4f41 (diff) | |
download | servo-830e6741c76a5eef85096d0378484d62f70c911a.tar.gz servo-830e6741c76a5eef85096d0378484d62f70c911a.zip |
Fix warnings in util.
Diffstat (limited to 'components/util/debug_utils.rs')
-rw-r--r-- | components/util/debug_utils.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/util/debug_utils.rs b/components/util/debug_utils.rs index 1eaa5085c8b..8d9789de029 100644 --- a/components/util/debug_utils.rs +++ b/components/util/debug_utils.rs @@ -10,25 +10,25 @@ use std::slice; fn hexdump_slice(buf: &[u8]) { let mut stderr = io::stderr(); - stderr.write(b" ").unwrap(); + stderr.write_all(b" ").unwrap(); for (i, &v) in buf.iter().enumerate() { let output = format!("{:02X} ", v as uint); - stderr.write(output.as_bytes()).unwrap(); + stderr.write_all(output.as_bytes()).unwrap(); match i % 16 { - 15 => { stderr.write(b"\n ").unwrap(); }, - 7 => { stderr.write(b" ").unwrap(); }, + 15 => { stderr.write_all(b"\n ").unwrap(); }, + 7 => { stderr.write_all(b" ").unwrap(); }, _ => () } stderr.flush().unwrap(); } - stderr.write(b"\n").unwrap(); + stderr.write_all(b"\n").unwrap(); } pub fn hexdump<T>(obj: &T) { unsafe { let buf: *const u8 = mem::transmute(obj); debug!("dumping at {:p}", buf); - let from_buf = slice::from_raw_buf(&buf, size_of::<T>()); + let from_buf = slice::from_raw_parts(buf, size_of::<T>()); hexdump_slice(from_buf); } } |