This commit is contained in:
sxyazi 2024-02-04 08:34:15 +08:00
parent 4070bc09b9
commit 2b09b40fcb
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View file

@ -17,9 +17,11 @@ pub fn slim_lua() -> mlua::Result<Lua> {
// Elements // Elements
let ui = lua.create_table()?; let ui = lua.create_table()?;
elements::Line::install(&lua, &ui)?;
elements::Paragraph::install(&lua, &ui)?; elements::Paragraph::install(&lua, &ui)?;
elements::Rect::install(&lua, &ui)?;
elements::Rect::register(&lua)?; elements::Rect::register(&lua)?;
elements::Rect::install(&lua, &ui)?;
elements::Span::install(&lua, &ui)?;
lua.globals().set("ui", ui)?; lua.globals().set("ui", ui)?;
Ok(lua) Ok(lua)

View file

@ -32,7 +32,7 @@ impl Utils {
}; };
named.insert(s.to_str()?.replace('_', "-"), v); named.insert(s.to_str()?.replace('_', "-"), v);
} }
_ => Err("invalid key in cmd".into_lua_err())?, _ => return Err("invalid key in cmd".into_lua_err()),
} }
} }
Ok((args, named)) Ok((args, named))