Closed
Description
The custom message in assert_eq!(...) macro is shown right after the right:
. This is hard to read because the value strings could be very long. I think it is better to print the custom message (if available) on a separate line.
fn main() {
let a = 10;
let b = 20;
assert_eq!(a, b, "Values {a} and {b}");
}
The above code (playground) prints this:
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `10`,
right: `20`: Values 10 and 20', src/main.rs:4:5
Suggested output
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `10`,
right: `20`,
context: Values 10 and 20', src/main.rs:4:5
Note that custom message and the location in source are still on the same line