import Any

This commit is contained in:
numzero 2026-05-07 21:50:17 +03:00
parent f94950afb9
commit f03e554181

View File

@ -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);