Skip to content

Commit 1259170

Browse files
authored
Impl From<T> for MutBorrow<T> (#71)
1 parent 7b98b47 commit 1259170

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/unsafe_self_cell.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,11 @@ impl<T> MutBorrow<T> {
302302
self.value.into_inner()
303303
}
304304
}
305+
impl<T> From<T> for MutBorrow<T> {
306+
fn from(value: T) -> Self {
307+
Self::new(value)
308+
}
309+
}
305310

306311
// SAFETY: The reasoning why it is safe to share `MutBorrow` across threads is as follows: The
307312
// `AtomicBool` `is_locked` ensures that only ever exactly one thread can get access to the inner

0 commit comments

Comments
 (0)