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 {
#[inline]
fn from(c: &'static Control) -> Self { Self::Borrowed(c) }
}
impl From<Control> for ControlCow {
#[inline]
fn from(c: Control) -> Self { Self::Owned(c) }
}
impl Deref for ControlCow {
type Target = Control;
#[inline]
fn deref(&self) -> &Self::Target {
match self {
Self::Owned(c) => c,