diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-02-13 05:33:49 -0700 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-02-13 05:33:49 -0700 |
commit | 66f4faf44fbc6e8703d4336219a20dd3b19fb493 (patch) | |
tree | c018ce182aeb613f8ab46a2c403abb1340e6defc /components/util/debug_utils.rs | |
parent | 11b627704d539122bdf9755644fb5bc0c6a03bb6 (diff) | |
parent | 830e6741c76a5eef85096d0378484d62f70c911a (diff) | |
download | servo-66f4faf44fbc6e8703d4336219a20dd3b19fb493.tar.gz servo-66f4faf44fbc6e8703d4336219a20dd3b19fb493.zip |
auto merge of #4922 : servo/servo/warnings, r=jdm
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); } } |