mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Try to solve issue3456. (#3556)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
macro_rules! assert_approx_eq {
|
||||
($a:expr, $b:expr, $eps:expr) => {{
|
||||
let (a, b) = (&$a, &$b);
|
||||
assert!(
|
||||
(*a - *b).abs() < $eps,
|
||||
"assertion failed: `(left !== right)` \
|
||||
(left: `{:?}`, right: `{:?}`, expect diff: `{:?}`, real diff: `{:?}`)",
|
||||
*a,
|
||||
*b,
|
||||
$eps,
|
||||
(*a - *b).abs()
|
||||
);
|
||||
}};
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
// format_strings is false by default.
|
||||
|
||||
println!(
|
||||
"DirEntry {{ \
|
||||
binary_name: {:<64}, \
|
||||
context_id: {:>2}, \
|
||||
file_size: {:>6}, \
|
||||
offset: 0x {:>08X}, \
|
||||
actual_crc: 0x{:>08X} \
|
||||
}}",
|
||||
dir_entry.binary_name,
|
||||
dir_entry.context_id,
|
||||
dir_entry.file_size,
|
||||
dir_entry.offset,
|
||||
dir_entry.actual_crc
|
||||
);
|
||||
Reference in New Issue
Block a user