import Any
This commit is contained in:
parent
f94950afb9
commit
f03e554181
|
|
@ -1,4 +1,5 @@
|
||||||
use std::{
|
use std::{
|
||||||
|
any::Any,
|
||||||
marker::PhantomData,
|
marker::PhantomData,
|
||||||
mem::ManuallyDrop,
|
mem::ManuallyDrop,
|
||||||
ops::{Deref, DerefMut},
|
ops::{Deref, DerefMut},
|
||||||
|
|
@ -56,7 +57,7 @@ impl<T> OwnRef<'_, T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl OwnRef<'_, dyn std::any::Any> {
|
impl OwnRef<'_, dyn Any> {
|
||||||
pub fn take<U: 'static>(mut self) -> Result<U, Self> {
|
pub fn take<U: 'static>(mut self) -> Result<U, Self> {
|
||||||
if !self.is::<U>() {
|
if !self.is::<U>() {
|
||||||
return Err(self);
|
return Err(self);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user