fix compilation warnings #959

Merged
lx merged 5 commits from fixes into main 2025-02-14 17:32:31 +00:00
2 changed files with 9 additions and 2 deletions
Showing only changes of commit 24470377c9 - Show all commits

View file

@ -329,7 +329,7 @@ impl Garage {
pub async fn locked_helper(&self) -> helper::locked::LockedHelper {
let lock = self.bucket_lock.lock().await;
helper::locked::LockedHelper(self, lock)
helper::locked::LockedHelper(self, Some(lock))
}
}

View file

@ -27,9 +27,16 @@ use crate::permission::BucketKeyPerm;
/// See issues: #649, #723
pub struct LockedHelper<'a>(
pub(crate) &'a Garage,
pub(crate) tokio::sync::MutexGuard<'a, ()>,
pub(crate) Option<tokio::sync::MutexGuard<'a, ()>>,
);
impl<'a> Drop for LockedHelper<'a> {
fn drop(&mut self) {
// make it explicit that the mutexguard lives until here
drop(self.1.take())
}
}
#[allow(clippy::ptr_arg)]
impl<'a> LockedHelper<'a> {
pub fn bucket(&self) -> BucketHelper<'a> {