tony / oxwm

config/lua: apply clippy lint Browse files
emzywastaken committed 2025-12-15 parent 585a932 commit d42a978255ed6bbdfa8ac1f0d70d1985ed1002c6
Showing 1 changed file with 9 additions and 9 deletions. UnifiedSplit
+9 −9 src/config/lua.rs
@@ -9,13 +9,13 @@ pub fn parse_lua_config(
9 ) -> Result<crate::Config, ConfigError> { 9 ) -> Result<crate::Config, ConfigError> {
10 let lua = Lua::new(); 10 let lua = Lua::new();
11 11
12 - if let Some(dir) = config_dir { 12 + if let Some(dir) = config_dir
13 - if let Some(dir_str) = dir.to_str() { 13 + && let Some(dir_str) = dir.to_str()
14 - let setup_code = format!("package.path = '{}/?.lua;' .. package.path", dir_str); 14 + {
15 - lua.load(&setup_code) 15 + let setup_code = format!("package.path = '{}/?.lua;' .. package.path", dir_str);
16 - .exec() 16 + lua.load(&setup_code)
17 - .map_err(|e| ConfigError::LuaError(format!("Failed to set package.path: {}", e)))?; 17 + .exec()
18 - } 18 + .map_err(|e| ConfigError::LuaError(format!("Failed to set package.path: {}", e)))?;
19 } 19 }
20 20
21 let builder = lua_api::register_api(&lua)?; 21 let builder = lua_api::register_api(&lua)?;
@@ -26,7 +26,7 @@ pub fn parse_lua_config(
26 26
27 let builder_data = builder.borrow().clone(); 27 let builder_data = builder.borrow().clone();
28 28
29 - return Ok(crate::Config { 29 + Ok(crate::Config {
30 border_width: builder_data.border_width, 30 border_width: builder_data.border_width,
31 border_focused: builder_data.border_focused, 31 border_focused: builder_data.border_focused,
32 border_unfocused: builder_data.border_unfocused, 32 border_unfocused: builder_data.border_unfocused,
@@ -51,5 +51,5 @@ pub fn parse_lua_config(
51 autostart: builder_data.autostart, 51 autostart: builder_data.autostart,
52 auto_tile: builder_data.auto_tile, 52 auto_tile: builder_data.auto_tile,
53 path: None, 53 path: None,
54 - }); 54 + })
55 } 55 }