You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
701: Add {Atomic, Shared}::try_into_owned r=taiki-e a=PatrickNorton
Sometimes, I have run into times when I have had an `Atomic` which I know to be either null or valid, and I want to convert it into an `Owned`. As far as I can tell, there is no way to do this without converting through a `Shared`, which comes at the const of an additional atomic load. This pull request also adds the same method to `Shared` for symmetry.
This pull request adds the following methods:
```rust
impl<T: ?Sized + Pointable> Owned<T> {
pub unsafe fn try_into_owned(self) -> Option<Owned<T>>;
}
impl<T: ?Sized + Pointable> Shared<'_, T> {
pub unsafe fn try_into_owned(self) -> Option<Owned<T>>;
}
```
Co-authored-by: Patrick Norton <[email protected]>
Co-authored-by: Taiki Endo <[email protected]>
0 commit comments