fanbox api: add list home

This commit is contained in:
2022-06-25 02:19:10 +00:00
committed by GitHub
parent 12c01ccb95
commit af3a2c5680
3 changed files with 132 additions and 8 deletions

View File

@@ -1,5 +1,6 @@
use crate::ext::rw_lock::GetRwLock;
use std::ops::DerefMut;
use std::sync::MutexGuard;
use std::sync::RwLock;
use std::sync::RwLockWriteGuard;
@@ -30,6 +31,20 @@ impl<T> ReplaceWith<T> for T {
}
}
impl<'a, T> ReplaceWith<T> for MutexGuard<'a, T> {
#[inline]
fn replace_with(&mut self, another: T) -> T {
self.deref_mut().replace_with(another)
}
}
impl<'a, T> ReplaceWith<T> for futures_util::lock::MutexGuard<'a, T> {
#[inline]
fn replace_with(&mut self, another: T) -> T {
self.deref_mut().replace_with(another)
}
}
impl<'a, T> ReplaceWith<T> for RwLockWriteGuard<'a, T> {
#[inline]
fn replace_with(&mut self, another: T) -> T {