summaryrefslogtreecommitdiffstats
path: root/core/src/macros.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/macros.rs')
-rw-r--r--core/src/macros.rs37
1 files changed, 18 insertions, 19 deletions
diff --git a/core/src/macros.rs b/core/src/macros.rs
index f820ec4..4aaf8cb 100644
--- a/core/src/macros.rs
+++ b/core/src/macros.rs
@@ -1,4 +1,3 @@
-
#[cfg(test)]
macro_rules! assert_not {
//direct forward + `!`
@@ -7,39 +6,39 @@ macro_rules! assert_not {
#[cfg(test)]
macro_rules! assert_ok {
- ($val:expr) => ({
+ ($val:expr) => {{
match $val {
Ok(res) => res,
- Err(err) => panic!( "expected Ok(..) got Err({:?})", err)
+ Err(err) => panic!("expected Ok(..) got Err({:?})", err),
}
- });
- ($val:expr, $ctx:expr) => ({
+ }};
+ ($val:expr, $ctx:expr) => {{
match $val {
- Ok( res ) => res,
- Err(err) => panic!( "expected Ok(..) got Err({:?}) [ctx: {:?}]", err, $ctx)
+ Ok(res) => res,
+ Err(err) => panic!("expected Ok(..) got Err({:?}) [ctx: {:?}]", err, $ctx),
}
- });
+ }};
}
#[cfg(test)]
macro_rules! assert_err {
- ($val:expr) => ({
+ ($val:expr) => {{
match $val {
- Ok( val ) => panic!( "expected Err(..) got Ok({:?})", val),
- Err( err ) => err,
+ Ok(val) => panic!("expected Err(..) got Ok({:?})", val),
+ Err(err) => err,
}
- });
- ($val:expr, $ctx:expr) => ({
+ }};
+ ($val:expr, $ctx:expr) => {{
match $val {
- Ok( val ) => panic!( "expected Err(..) got Ok({:?}) [ctx: {:?}]", val, $ctx),
- Err( err ) => err,
+ Ok(val) => panic!("expected Err(..) got Ok({:?}) [ctx: {:?}]", val, $ctx),
+ Err(err) => err,
}
- });
+ }};
}
#[cfg(test)]
macro_rules! test {
- ($name:ident, $code:block) => (
+ ($name:ident, $code:block) => {
#[test]
fn $name() {
let catch_block = || -> Result<(), ::error::MailError> {
@@ -48,5 +47,5 @@ macro_rules! test {
};
(catch_block)().unwrap();
}
- );
-} \ No newline at end of file
+ };
+}