summaryrefslogtreecommitdiff
path: root/test/sys
diff options
context:
space:
mode:
authorBryant Mairs <bryantmairs@google.com>2017-12-15 15:49:50 -0800
committerBryant Mairs <bryantmairs@google.com>2017-12-20 07:05:04 -0800
commitd203e92ad7e2d17935bc81fdf0082eebe0ab5ebe (patch)
tree27a0f1850a2dc6fcedeebdf56cfe31678315590e /test/sys
parentb814db046aed7a0a683d4f14e622a721ddcff8cb (diff)
downloadnix-d203e92ad7e2d17935bc81fdf0082eebe0ab5ebe.zip
Remove match statements with one arm
Diffstat (limited to 'test/sys')
-rw-r--r--test/sys/test_ptrace.rs10
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!");
}
}