Skip to content

Commit 7e7908c

Browse files
committed
No need to explicitly call drop since SaGuard goes out of scope
1 parent 4559bcc commit 7e7908c

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

libdd-crashtracker/src/collector/saguard.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,11 @@ mod tests {
9595
#[test]
9696
#[cfg_attr(miri, ignore)]
9797
fn signal_is_ignored_while_guard_is_active() {
98-
let guard = SaGuard::<1>::new(&[Signal::SIGUSR1]).unwrap();
98+
let _guard = SaGuard::<1>::new(&[Signal::SIGUSR1]).unwrap();
9999

100100
// Send SIGUSR1 to the process. The default action is to terminate, so if
101101
// the guard didn't set SIG_IGN this test process would die
102102
signal::kill(Pid::this(), Signal::SIGUSR1).unwrap();
103-
104-
// If we get here, signal was successfully ignored
105-
drop(guard);
106103
}
107104

108105
/// After the guard is dropped, the original handler should be restored.
@@ -153,12 +150,10 @@ mod tests {
153150
#[test]
154151
#[cfg_attr(miri, ignore)]
155152
fn multiple_signals_ignored() {
156-
let guard = SaGuard::<2>::new(&[Signal::SIGUSR1, Signal::SIGUSR2]).unwrap();
153+
let _guard = SaGuard::<2>::new(&[Signal::SIGUSR1, Signal::SIGUSR2]).unwrap();
157154

158155
// Both signals should be safely ignored
159156
signal::kill(Pid::this(), Signal::SIGUSR1).unwrap();
160157
signal::kill(Pid::this(), Signal::SIGUSR2).unwrap();
161-
162-
drop(guard);
163158
}
164159
}

0 commit comments

Comments
 (0)