Skip to content

Commit 7815487

Browse files
author
Bryant Mairs
committed
Remove match statements with one arm
1 parent f556087 commit 7815487

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/sys/test_ptrace.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,17 @@ fn test_ptrace_getevent() {
3030
// Just make sure ptrace_getsiginfo can be called at all, for now.
3131
#[test]
3232
fn test_ptrace_getsiginfo() {
33-
match ptrace::getsiginfo(getpid()) {
34-
Err(Error::UnsupportedOperation) => panic!("ptrace_getsiginfo returns Error::UnsupportedOperation!"),
35-
_ => (),
33+
if let Err(Error::UnsupportedOperation) = ptrace::getsiginfo(getpid()) {
34+
panic!("ptrace_getsiginfo returns Error::UnsupportedOperation!");
3635
}
3736
}
3837

3938
// Just make sure ptrace_setsiginfo can be called at all, for now.
4039
#[test]
4140
fn test_ptrace_setsiginfo() {
4241
let siginfo = unsafe { mem::uninitialized() };
43-
match ptrace::setsiginfo(getpid(), &siginfo) {
44-
Err(Error::UnsupportedOperation) => panic!("ptrace_setsiginfo returns Error::UnsupportedOperation!"),
45-
_ => (),
42+
if let Err(Error::UnsupportedOperation) = ptrace::setsiginfo(getpid(), &siginfo) {
43+
panic!("ptrace_setsiginfo returns Error::UnsupportedOperation!");
4644
}
4745
}
4846

0 commit comments

Comments
 (0)