Skip to content

Commit

Permalink
Add into_inner methods. (#3110)
Browse files Browse the repository at this point in the history
  • Loading branch information
KmolYuan committed Aug 9, 2023
1 parent 46daaa8 commit 20be084
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions crates/epaint/src/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ mod mutex_impl {

MutexGuard(self.0.lock(), ptr)
}

#[inline(always)]
pub fn into_inner(self) -> T {
self.0.into_inner()
}
}

impl<T> Drop for MutexGuard<'_, T> {
Expand Down Expand Up @@ -314,6 +319,11 @@ mod rw_lock_impl {
holders: Arc::clone(&self.holders),
}
}

#[inline(always)]
pub fn into_inner(self) -> T {
self.lock.into_inner()
}
}

fn make_backtrace() -> backtrace::Backtrace {
Expand Down Expand Up @@ -366,6 +376,11 @@ mod mutex_impl {
pub fn lock(&self) -> MutexGuard<'_, T> {
self.0.borrow_mut()
}

#[inline(always)]
pub fn into_inner(self) -> T {
self.0.into_inner()
}
}
}

Expand Down Expand Up @@ -401,6 +416,11 @@ mod rw_lock_impl {
pub fn write(&self) -> RwLockWriteGuard<'_, T> {
self.0.borrow_mut()
}

#[inline(always)]
pub fn into_inner(self) -> T {
self.0.into_inner()
}
}
}

Expand Down

0 comments on commit 20be084

Please sign in to comment.