From 7db6d0233354679a946132936fc88c879f8c5807 Mon Sep 17 00:00:00 2001 From: sxyazi Date: Wed, 28 May 2025 16:37:27 +0800 Subject: [PATCH] .. --- yazi-plugin/src/elements/align.rs | 12 +++++------- yazi-plugin/src/elements/wrap.rs | 12 +++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/yazi-plugin/src/elements/align.rs b/yazi-plugin/src/elements/align.rs index 4f437ce2..564cfa70 100644 --- a/yazi-plugin/src/elements/align.rs +++ b/yazi-plugin/src/elements/align.rs @@ -30,13 +30,11 @@ impl FromLua for Align { 0 => ratatui::layout::Alignment::Left, 1 => ratatui::layout::Alignment::Center, 2 => ratatui::layout::Alignment::Right, - _ => { - return Err(mlua::Error::FromLuaConversionError { - from: value.type_name(), - to: "Align".to_string(), - message: Some("invalid value for Align".to_string()), - }); - } + _ => Err(mlua::Error::FromLuaConversionError { + from: value.type_name(), + to: "Align".to_string(), + message: Some("invalid value for Align".to_string()), + })?, })) } } diff --git a/yazi-plugin/src/elements/wrap.rs b/yazi-plugin/src/elements/wrap.rs index 7509a87d..127e8bbf 100644 --- a/yazi-plugin/src/elements/wrap.rs +++ b/yazi-plugin/src/elements/wrap.rs @@ -40,13 +40,11 @@ impl FromLua for Wrap { 0 => None, 1 => Some(ratatui::widgets::Wrap { trim: false }), 2 => Some(ratatui::widgets::Wrap { trim: true }), - _ => { - return Err(mlua::Error::FromLuaConversionError { - from: value.type_name(), - to: "Wrap".to_string(), - message: Some("invalid value for Wrap".to_string()), - }); - } + _ => Err(mlua::Error::FromLuaConversionError { + from: value.type_name(), + to: "Wrap".to_string(), + message: Some("invalid value for Wrap".to_string()), + })?, })) } }