From 9b3c56535bb15d4be470aa8cccda9ba40c2cf1c3 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 9 Mar 2024 03:05:37 +0800 Subject: [PATCH] .. --- yazi-config/src/headsup/headsup.rs | 1 + yazi-plugin/src/bindings/permit.rs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/yazi-config/src/headsup/headsup.rs b/yazi-config/src/headsup/headsup.rs index f9420e05..062725fa 100644 --- a/yazi-config/src/headsup/headsup.rs +++ b/yazi-config/src/headsup/headsup.rs @@ -4,6 +4,7 @@ use crate::MERGED_YAZI; #[derive(Debug)] pub struct Headsup { + // TODO: remove this once Yazi 0.3 is released -- pub disable_exec_warn: bool, } diff --git a/yazi-plugin/src/bindings/permit.rs b/yazi-plugin/src/bindings/permit.rs index 73e775fc..4dfb0b6a 100644 --- a/yazi-plugin/src/bindings/permit.rs +++ b/yazi-plugin/src/bindings/permit.rs @@ -7,7 +7,7 @@ pub type PermitRef<'lua, F> = mlua::UserDataRef<'lua, Permit>; pub struct Permit { inner: Option>, - callback: Option, + destruct: Option, } impl Deref for Permit { @@ -17,12 +17,12 @@ impl Deref for Permit { } impl Permit { - pub fn new(permit: SemaphorePermit<'static>, f: F) -> Self { - Self { inner: Some(permit), callback: Some(f) } + pub fn new(inner: SemaphorePermit<'static>, f: F) -> Self { + Self { inner: Some(inner), destruct: Some(f) } } fn dropping(&mut self) { - if let Some(f) = self.callback.take() { + if let Some(f) = self.destruct.take() { f(); } if let Some(p) = self.inner.take() {