use std::{
hash::Hash,
ops::{
Deref,
DerefMut,
},
};
#[derive(Clone)]
pub struct Captured<T: Clone>(pub T);
impl<T: Clone> Hash for Captured<T> {
fn hash<H: std::hash::Hasher>(&self, _state: &mut H) {}
}
impl<T: Clone> PartialEq for Captured<T> {
fn eq(&self, _other: &Self) -> bool {
true
}
}
impl<T: Clone> Eq for Captured<T> {}
impl<T: Clone> Deref for Captured<T> {
type Target = T;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<T: Clone> DerefMut for Captured<T> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}