Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
wez committed Jan 17, 2022
1 parent 6c19e5a commit 4b457da
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions config/src/lua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub fn make_lua_context(config_file: &Path) -> anyhow::Result<Lua> {

wezterm_mod.set("target_triple", crate::wezterm_target_triple())?;
wezterm_mod.set("version", crate::wezterm_version())?;
wezterm_mod.set("nerdfonts", NerdFonts{})?;
wezterm_mod.set("nerdfonts", NerdFonts {})?;
wezterm_mod.set("home_dir", crate::HOME_DIR.to_str())?;
wezterm_mod.set(
"running_under_wsl",
Expand Down Expand Up @@ -1034,8 +1034,13 @@ struct NerdFonts {}

impl mlua::UserData for NerdFonts {
fn add_methods<'lua, M: mlua::UserDataMethods<'lua, Self>>(methods: &mut M) {
methods.add_meta_method(mlua::MetaMethod::Index, |_, _, key: String| -> mlua::Result<Option<String>> {
Ok(termwiz::nerdfonts::NERD_FONTS.get(key.as_str()).map(|c| c.to_string()))
});
methods.add_meta_method(
mlua::MetaMethod::Index,
|_, _, key: String| -> mlua::Result<Option<String>> {
Ok(termwiz::nerdfonts::NERD_FONTS
.get(key.as_str())
.map(|c| c.to_string()))
},
);
}
}

0 comments on commit 4b457da

Please sign in to comment.