]>
git.proxmox.com Git - rustc.git/blob - vendor/criterion/src/macros_private.rs
1 //! Private macro used for error handling.
3 /// Logs an error, ignores an `Ok` value.
4 macro_rules
! log_if_err
{
13 /// Matches a result, returning the `Ok` value in case of success,
14 /// exits the calling function otherwise.
15 /// A closure which returns the return value for the function can
16 /// be passed as second parameter.
17 macro_rules
! try_else_return
{
19 try_else_return
!($x
, || {}
)
21 ($x
:expr
, $el
:expr
) => {
25 crate::error
::log_error(&e
);
33 /// Print an error message to stdout. Format is the same as println! or format!
36 println
!("Criterion.rs ERROR: {}", &format
!($
($arg
)*))
40 /// Print a debug message to stdout. Format is the same as println! or format!
43 if $
crate::debug_enabled() {
44 println
!("Criterion.rs DEBUG: {}", &format
!($
($arg
)*))