refactor: add ArcMutex/ArcRwLock type aliases

Replace repeated Arc> and Arc> with concise type aliases for readability.
This commit is contained in:
Nils Andreas Svee committed 2026-04-18 19:04:35 +02:00
1 parent 7c40990e93
commit d0e3394f03
4 files changed
+17 -13

No files matched your search

+4 -1
View File
@@ -1,5 +1,8 @@
use anyhow::anyhow;
use std::sync::{Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
use std::sync::{Arc, Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard};
pub type ArcMutex<T> = Arc<Mutex<T>>;
pub type ArcRwLock<T> = Arc<RwLock<T>>;
pub trait MutexExt<T> {
fn lock_anyhow(&self) -> anyhow::Result<MutexGuard<'_, T>>;