From 92eb5fae390ea44116e91bc20490397fb6f54f89 Mon Sep 17 00:00:00 2001 From: xzeldon Date: Sat, 17 Apr 2021 04:28:25 +0300 Subject: [PATCH] remove unused code blocks --- src/console.rs | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/console.rs b/src/console.rs index 960aac3..963fbff 100644 --- a/src/console.rs +++ b/src/console.rs @@ -66,27 +66,4 @@ pub fn set_ctrl_c_handler() { while running.load(sync::atomic::Ordering::SeqCst) {} println!("> Exiting..."); process::exit(0); -} - -pub fn get_raw_command_line() -> String { - // use winapi::um::processenv::GetCommandLineW; - - unsafe { - let line = GetCommandLineW(); - - let mut cursor = line; - let mut length = 0; - while *cursor != 0 { - length += 1; - cursor = cursor.add(1); - } - let array: &[u16] = std::slice::from_raw_parts(line, length); - - String::from_utf16(array).expect("Invalid unicode") - } -} - -#[link(name="kernel32")] -extern "system" { - fn GetCommandLineW() -> *const u16; } \ No newline at end of file