From 1e1eb95926f556e666bc20355327abd24d264858 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Thu, 1 Aug 2024 22:07:04 +0200 Subject: minor cleanup --- src/config/theme/mod.rs | 2 +- src/config/theme/sheetview.rs | 2 +- src/config/theme/style.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/config/theme') diff --git a/src/config/theme/mod.rs b/src/config/theme/mod.rs index 35101c5..75f65a0 100644 --- a/src/config/theme/mod.rs +++ b/src/config/theme/mod.rs @@ -8,7 +8,7 @@ use super::DUMMY_CONFIG; pub mod style; pub mod sheetview; -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub struct Theme { pub sheetview: SheetViewTheme, } diff --git a/src/config/theme/sheetview.rs b/src/config/theme/sheetview.rs index 30d801e..edc7cc3 100644 --- a/src/config/theme/sheetview.rs +++ b/src/config/theme/sheetview.rs @@ -8,7 +8,7 @@ use crate::{ use super::style::Style; -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Default)] pub struct SheetViewTheme { pub cursor: EvalTo, pub selection: EvalTo, diff --git a/src/config/theme/style.rs b/src/config/theme/style.rs index 6e8d161..87cd068 100644 --- a/src/config/theme/style.rs +++ b/src/config/theme/style.rs @@ -3,7 +3,7 @@ use std::str::FromStr; use mlua::{FromLua, IntoLua}; use ratatui::style::{Color, Styled, Stylize}; -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, Default)] pub struct Style { pub fg: Option, pub bg: Option, @@ -102,7 +102,7 @@ impl<'lua> FromLua<'lua> for Style { return Ok(style) } - return Err(mlua::Error::runtime("could not parse style")); + Err(mlua::Error::runtime("could not parse style")) } } @@ -114,6 +114,6 @@ impl<'lua> IntoLua<'lua> for Style { let table = lua.create_table()?; table.set("fg", self.fg.map(|s| s.to_string()).into_lua(lua)?)?; table.set("bg", self.bg.map(|s| s.to_string()).into_lua(lua)?)?; - Ok(table.into_lua(lua)?) + table.into_lua(lua) } } -- cgit v1.2.3-70-g09d2