From 5e7a75e1a5252f063ba1068920a0dd11a5477721 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Tue, 4 Apr 2023 15:11:09 -0700 Subject: [PATCH] Use 'parking_lot' 'Mutex' in fairing's 'Once'. --- core/lib/src/fairing/ad_hoc.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/lib/src/fairing/ad_hoc.rs b/core/lib/src/fairing/ad_hoc.rs index 2add55a7..f4ea6e1b 100644 --- a/core/lib/src/fairing/ad_hoc.rs +++ b/core/lib/src/fairing/ad_hoc.rs @@ -1,6 +1,5 @@ -use std::sync::Mutex; - use futures::future::{Future, BoxFuture, FutureExt}; +use parking_lot::Mutex; use crate::{Rocket, Request, Response, Data, Build, Orbit}; use crate::fairing::{Fairing, Kind, Info, Result}; @@ -47,7 +46,7 @@ impl Once { #[track_caller] fn take(&self) -> Box { - self.0.lock().expect("Once::lock()").take().expect("Once::take() called once") + self.0.lock().take().expect("Once::take() called once") } }