1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
use std::ops::{Deref, DerefMut};
#[allow(unused_imports)]
use crate::none_object_pool::NoneObjectPool;
pub struct NoneReusable<T> {
data: T,
}
impl<T> NoneReusable<T> {
#[inline]
pub fn new(data: T) -> Self {
Self { data }
}
}
impl<T> DerefMut for NoneReusable<T> {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.data
}
}
impl<T> Deref for NoneReusable<T> {
type Target = T;
#[inline]
fn deref(&self) -> &Self::Target {
&self.data
}
}