aquatic_common: fix clippy warnings

This commit is contained in:
Joakim Frostegård 2024-01-20 10:37:15 +01:00
parent 746aa47cce
commit 2dd3ab8682
6 changed files with 23 additions and 23 deletions

View file

@ -39,6 +39,7 @@ impl ValidUntil {
pub struct ServerStartInstant(Instant);
impl ServerStartInstant {
#[allow(clippy::new_without_default)] // I prefer ::new here
pub fn new() -> Self {
Self(Instant::now())
}
@ -82,13 +83,11 @@ impl Drop for PanicSentinel {
if ::std::thread::panicking() {
let already_triggered = self.0.fetch_or(true, Ordering::SeqCst);
if !already_triggered {
if unsafe { libc::raise(15) } == -1 {
panic!(
"Could not raise SIGTERM: {:#}",
::std::io::Error::last_os_error()
)
}
if !already_triggered && unsafe { libc::raise(15) } == -1 {
panic!(
"Could not raise SIGTERM: {:#}",
::std::io::Error::last_os_error()
)
}
}
}