From 8b1a81ded3a42dc935a5f04a35873d94184d52a3 Mon Sep 17 00:00:00 2001 From: nganhkhoa Date: Mon, 11 Oct 2021 16:13:50 +0700 Subject: [PATCH] format code --- src/bridge/ui_commands.rs | 6 ++++-- src/windows_utils.rs | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/bridge/ui_commands.rs b/src/bridge/ui_commands.rs index 567128f..6da5764 100644 --- a/src/bridge/ui_commands.rs +++ b/src/bridge/ui_commands.rs @@ -143,7 +143,8 @@ impl ParallelCommand { #[cfg(windows)] ParallelCommand::RegisterRightClick => { if unregister_rightclick() { - let msg = "Could not unregister previous menu item. Possibly already registered."; + let msg = + "Could not unregister previous menu item. Possibly already registered."; nvim.err_writeln(msg).await.ok(); error!("{}", msg); } @@ -153,7 +154,8 @@ impl ParallelCommand { error!("{}", msg); } if !register_rightclick_file() { - let msg = "Could not register file context menu item. Possibly already registered."; + let msg = + "Could not register file context menu item. Possibly already registered."; nvim.err_writeln(msg).await.ok(); error!("{}", msg); } diff --git a/src/windows_utils.rs b/src/windows_utils.rs index 1c069f2..fbcf83f 100644 --- a/src/windows_utils.rs +++ b/src/windows_utils.rs @@ -34,7 +34,8 @@ fn get_binary_path() -> String { #[cfg(target_os = "windows")] pub fn unregister_rightclick() -> bool { - let str_registry_path_1 = CString::new("Software\\Classes\\Directory\\Background\\shell\\Neovide").unwrap(); + let str_registry_path_1 = + CString::new("Software\\Classes\\Directory\\Background\\shell\\Neovide").unwrap(); let str_registry_path_2 = CString::new("Software\\Classes\\*\\shell\\Neovide").unwrap(); unsafe { let s1 = RegDeleteTreeA(HKEY_CURRENT_USER, str_registry_path_1.as_ptr()); @@ -47,7 +48,8 @@ pub fn unregister_rightclick() -> bool { pub fn register_rightclick_directory() -> bool { let neovide_path = get_binary_path(); let mut registry_key: HKEY = null_mut(); - let str_registry_path = CString::new("Software\\Classes\\Directory\\Background\\shell\\Neovide").unwrap(); + let str_registry_path = + CString::new("Software\\Classes\\Directory\\Background\\shell\\Neovide").unwrap(); let str_registry_command_path = CString::new("Software\\Classes\\Directory\\Background\\shell\\Neovide\\command").unwrap(); let str_icon = CString::new("Icon").unwrap(); @@ -136,7 +138,8 @@ pub fn register_rightclick_file() -> bool { let neovide_path = get_binary_path(); let mut registry_key: HKEY = null_mut(); let str_registry_path = CString::new("Software\\Classes\\*\\shell\\Neovide").unwrap(); - let str_registry_command_path = CString::new("Software\\Classes\\*\\shell\\Neovide\\command").unwrap(); + let str_registry_command_path = + CString::new("Software\\Classes\\*\\shell\\Neovide\\command").unwrap(); let str_icon = CString::new("Icon").unwrap(); let str_command = CString::new(format!("{} \"%1\"", neovide_path).as_bytes()).unwrap(); let str_description = CString::new("Open with Neovide").unwrap();