diff --git a/yazi-fm/src/app/commands/plugin.rs b/yazi-fm/src/app/commands/plugin.rs index 5219f108..8b7c6b8e 100644 --- a/yazi-fm/src/app/commands/plugin.rs +++ b/yazi-fm/src/app/commands/plugin.rs @@ -1,5 +1,7 @@ +use std::fmt::Display; + use mlua::{ExternalError, ExternalResult, IntoLua, Table, TableExt, Value, Variadic}; -use tracing::error; +use tracing::{error, warn}; use yazi_plugin::{LOADED, LUA}; use yazi_shared::{emit, event::Exec, Layer}; @@ -26,9 +28,10 @@ impl App { }); } - pub(crate) fn plugin_do(&mut self, opt: impl TryInto) { - let Ok(opt) = opt.try_into() else { - return; + pub(crate) fn plugin_do(&mut self, opt: impl TryInto) { + let opt = match opt.try_into() { + Ok(opt) => opt as yazi_plugin::Opt, + Err(e) => return warn!("{e}"), }; let args = Variadic::from_iter(opt.data.args.into_iter().filter_map(|v| v.into_lua(&LUA).ok())); diff --git a/yazi-plugin/src/cast.rs b/yazi-plugin/src/cast.rs index 6388af4e..26d79359 100644 --- a/yazi-plugin/src/cast.rs +++ b/yazi-plugin/src/cast.rs @@ -22,6 +22,7 @@ pub fn cast_to_renderable(ud: AnyUserData) -> Option> } } +#[derive(Debug)] pub enum ValueSendable { Nil, Boolean(bool), @@ -96,7 +97,7 @@ impl ValueSendable { } } -#[derive(Hash, PartialEq, Eq)] +#[derive(Debug, Hash, PartialEq, Eq)] pub enum ValueSendableKey { Nil, Boolean(bool), diff --git a/yazi-shared/src/number.rs b/yazi-shared/src/number.rs index 5c939f13..70edd3bd 100644 --- a/yazi-shared/src/number.rs +++ b/yazi-shared/src/number.rs @@ -1,5 +1,6 @@ use std::hash::{Hash, Hasher}; +#[derive(Clone, Copy, Debug)] pub struct OrderedFloat(f64); impl OrderedFloat {