diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-02-02 11:27:52 +0100 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2019-02-02 11:27:52 +0100 |
commit | a31f73db289b00f81c5f70e60807ef7348f1a499 (patch) | |
tree | 6d51c0223778d4957ef1660f845fe5bd404d8538 /tests/util | |
parent | ad76653b3be57c0cfd31c8056a8d68537034324e (diff) | |
parent | 13006c00dcbd570cf8347d89557834e320427377 (diff) | |
download | nitrokey-rs-a31f73db289b00f81c5f70e60807ef7348f1a499.tar.gz nitrokey-rs-a31f73db289b00f81c5f70e60807ef7348f1a499.tar.bz2 |
Merge branch 'mutable-references' into next
RFC:
https://lists.sr.ht/~ireas/nitrokey-rs-dev/%3C20190126174327.tbuyk2s535kfiqm4%40localhost%3E
https://lists.sr.ht/~ireas/nitrokey-rs-dev/%3C43cc304d-23e8-7f95-2167-ce3f0530b81e%40posteo.net%3E
* mutable-references:
Store mutable reference to Device in PasswordSafe
Refactor User and Admin to use a mutable reference
Require mutable reference if method changes device state
Add device_mut method to DeviceWrapper
Implement DerefMut for User and Admin
Diffstat (limited to 'tests/util')
-rw-r--r-- | tests/util/mod.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/util/mod.rs b/tests/util/mod.rs index bd207a9..f80372d 100644 --- a/tests/util/mod.rs +++ b/tests/util/mod.rs @@ -8,7 +8,7 @@ pub static USER_PASSWORD: &str = "123456"; #[macro_export] macro_rules! unwrap_ok { - ($val:expr) => {{ + ($val:expr) => { match $val { Ok(val) => val, Err(err) => panic!( @@ -18,12 +18,12 @@ macro_rules! unwrap_ok { err ), } - }}; + }; } #[macro_export] macro_rules! assert_any_ok { - ($val:expr) => {{ + ($val:expr) => { match &$val { Ok(_) => {} Err(err) => panic!( @@ -33,12 +33,12 @@ macro_rules! assert_any_ok { err ), } - }}; + }; } #[macro_export] macro_rules! assert_ok { - ($left:expr, $right:expr) => {{ + ($left:expr, $right:expr) => { match &$right { Ok(right) => match &$left { left => { @@ -59,7 +59,7 @@ macro_rules! assert_ok { $left, right_err ), } - }}; + }; } #[macro_export] |