diff --git a/src/bridge/ui_commands.rs b/src/bridge/ui_commands.rs index e709e9e..19c8871 100644 --- a/src/bridge/ui_commands.rs +++ b/src/bridge/ui_commands.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use log::error; use log::trace; -use nvim_rs::{Neovim, call_args, rpc::model::IntoVal}; +use nvim_rs::{call_args, rpc::model::IntoVal, Neovim}; use tokio::sync::mpsc::{unbounded_channel, UnboundedReceiver}; use crate::bridge::TxWrapper; @@ -172,14 +172,11 @@ impl ParallelCommand { nvim.command("\"lcd ~").await.ok(); nvim.command("file scratch").await.ok(); nvim.call( - "nvim_buf_set_lines", - call_args![ - 0i64, - 0i64, - -1i64, - false, - content - ]).await.ok(); + "nvim_buf_set_lines", + call_args![0i64, 0i64, -1i64, false, content], + ) + .await + .ok(); } #[cfg(windows)] ParallelCommand::RegisterRightClick => { diff --git a/src/editor/mod.rs b/src/editor/mod.rs index 319caa4..1b79ca7 100644 --- a/src/editor/mod.rs +++ b/src/editor/mod.rs @@ -422,7 +422,7 @@ impl Editor { fn set_option(&mut self, gui_option: GuiOption) { trace!("Option set {:?}", &gui_option); if let GuiOption::GuiFont(guifont) = gui_option { - if guifont == "*".to_owned() { + if guifont == *"*" { self.window_command_sender .send(WindowCommand::ListAvailableFonts) .ok(); diff --git a/src/window/mod.rs b/src/window/mod.rs index f530fae..3ec6116 100644 --- a/src/window/mod.rs +++ b/src/window/mod.rs @@ -88,7 +88,7 @@ impl GlutinWindowWrapper { WindowCommand::TitleChanged(new_title) => self.handle_title_changed(new_title), WindowCommand::SetMouseEnabled(mouse_enabled) => { self.mouse_manager.enabled = mouse_enabled - }, + } WindowCommand::ListAvailableFonts => self.send_font_names(), } } @@ -101,7 +101,11 @@ impl GlutinWindowWrapper { pub fn send_font_names(&self) { let font_names = self.renderer.font_names(); - self.ui_command_sender.send(UiCommand::Parallel(ParallelCommand::DisplayAvailableFonts(font_names))).unwrap(); + self.ui_command_sender + .send(UiCommand::Parallel(ParallelCommand::DisplayAvailableFonts( + font_names, + ))) + .unwrap(); } pub fn handle_quit(&mut self) {