Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <patrick.147.norton@gmail.com> Co-authored-by: Taiki Endo <te316e89@gmail.com> Co-authored-by: PatrickNorton <36009535+PatrickNorton@users.noreply.github.com>
- Loading branch information