Skip to content

Commit 262d5a4

Browse files
author
root
committed
std: Use concat! and stringify! to simplify the most common assert! case.
With no custom message, we should just use concat! + stringify! for `assert!(expr)`. Inspired by issue #16625
1 parent 58bb603 commit 262d5a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ macro_rules! fail(
9696
macro_rules! assert(
9797
($cond:expr) => (
9898
if !$cond {
99-
fail!("assertion failed: {:s}", stringify!($cond))
99+
fail!(concat!("assertion failed: ", stringify!($cond)))
100100
}
101101
);
102102
($cond:expr, $($arg:expr),+) => (

0 commit comments

Comments
 (0)