This commit is contained in:
sxyazi 2024-01-31 08:58:23 +08:00
parent 614d8724a8
commit f85e8c9a80
No known key found for this signature in database

View file

@ -49,19 +49,16 @@ pub enum ControlCow {
} }
impl From<&'static Control> for ControlCow { impl From<&'static Control> for ControlCow {
#[inline]
fn from(c: &'static Control) -> Self { Self::Borrowed(c) } fn from(c: &'static Control) -> Self { Self::Borrowed(c) }
} }
impl From<Control> for ControlCow { impl From<Control> for ControlCow {
#[inline]
fn from(c: Control) -> Self { Self::Owned(c) } fn from(c: Control) -> Self { Self::Owned(c) }
} }
impl Deref for ControlCow { impl Deref for ControlCow {
type Target = Control; type Target = Control;
#[inline]
fn deref(&self) -> &Self::Target { fn deref(&self) -> &Self::Target {
match self { match self {
Self::Owned(c) => c, Self::Owned(c) => c,