diff options
author | David Hewitt <1939362+davidhewitt@users.noreply.github.com> | 2020-01-02 11:49:27 +0000 |
---|---|---|
committer | Christian Duerr <contact@christianduerr.com> | 2020-01-02 11:49:27 +0000 |
commit | f632919134414e31ffd3ae9b5732d673deb0adf5 (patch) | |
tree | 59e74ceabba1d08a5d5966502dda113b11143fc2 /alacritty_terminal/src/panic.rs | |
parent | 77acb26d7328f678b26c8aff2ee5706d78949c44 (diff) | |
download | r-alacritty-f632919134414e31ffd3ae9b5732d673deb0adf5.tar.gz r-alacritty-f632919134414e31ffd3ae9b5732d673deb0adf5.tar.bz2 r-alacritty-f632919134414e31ffd3ae9b5732d673deb0adf5.zip |
Clean up Windows PTY string handling
Removes widestring and dunce dependencies, reduces some code duplication
and corrects a few typos.
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() -} |