diff options
Diffstat (limited to 'alacritty_terminal/src/panic.rs')
-rw-r--r-- | alacritty_terminal/src/panic.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/alacritty_terminal/src/panic.rs b/alacritty_terminal/src/panic.rs index 4d3524ed..7f19c59a 100644 --- a/alacritty_terminal/src/panic.rs +++ b/alacritty_terminal/src/panic.rs @@ -13,6 +13,8 @@ // limitations under the License. // //! ANSI Terminal Stream Parsing +#[cfg(windows)] +use crate::tty::windows::win32_string; // Use the default behavior of the other platforms. #[cfg(not(windows))] @@ -41,13 +43,3 @@ pub fn attach_handler() { } })); } - -// Converts the string slice into a Windows-standard representation for "W"- -// suffixed function variants, which accept UTF-16 encoded string values. -#[cfg(windows)] -fn win32_string(value: &str) -> Vec<u16> { - use std::ffi::OsStr; - use std::iter::once; - use std::os::windows::ffi::OsStrExt; - OsStr::new(value).encode_wide().chain(once(0)).collect() -} |