diff options
author | Bryant Mairs <bryantmairs@google.com> | 2017-12-15 15:49:50 -0800 |
---|---|---|
committer | Bryant Mairs <bryantmairs@google.com> | 2017-12-20 07:05:04 -0800 |
commit | d203e92ad7e2d17935bc81fdf0082eebe0ab5ebe (patch) | |
tree | 27a0f1850a2dc6fcedeebdf56cfe31678315590e | |
parent | b814db046aed7a0a683d4f14e622a721ddcff8cb (diff) | |
download | nix-d203e92ad7e2d17935bc81fdf0082eebe0ab5ebe.zip |
Remove match statements with one arm
-rw-r--r-- | test/sys/test_ptrace.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/sys/test_ptrace.rs b/test/sys/test_ptrace.rs index f31ba877..debc4517 100644 --- a/test/sys/test_ptrace.rs +++ b/test/sys/test_ptrace.rs @@ -30,9 +30,8 @@ fn test_ptrace_getevent() { // Just make sure ptrace_getsiginfo can be called at all, for now. #[test] fn test_ptrace_getsiginfo() { - match ptrace::getsiginfo(getpid()) { - Err(Error::UnsupportedOperation) => panic!("ptrace_getsiginfo returns Error::UnsupportedOperation!"), - _ => (), + if let Err(Error::UnsupportedOperation) = ptrace::getsiginfo(getpid()) { + panic!("ptrace_getsiginfo returns Error::UnsupportedOperation!"); } } @@ -40,9 +39,8 @@ fn test_ptrace_getsiginfo() { #[test] fn test_ptrace_setsiginfo() { let siginfo = unsafe { mem::uninitialized() }; - match ptrace::setsiginfo(getpid(), &siginfo) { - Err(Error::UnsupportedOperation) => panic!("ptrace_setsiginfo returns Error::UnsupportedOperation!"), - _ => (), + if let Err(Error::UnsupportedOperation) = ptrace::setsiginfo(getpid(), &siginfo) { + panic!("ptrace_setsiginfo returns Error::UnsupportedOperation!"); } } |