Update win_commands.rs

Removed panic! lines. See [this](https://github.com/TimonPost/crossterm/issues/15) issue
This commit is contained in:
Timon 2018-06-13 18:47:58 +02:00 committed by GitHub
parent 7f17df8677
commit f63c58b889
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,14 +38,12 @@ impl ICommand for EnableAnsiCommand
let mut dw_mode: DWORD = 0; let mut dw_mode: DWORD = 0;
if !kernel::get_console_mode(&output_handle, &mut dw_mode) if !kernel::get_console_mode(&output_handle, &mut dw_mode)
{ {
panic!("Cannot get console mode");
return false; return false;
} }
dw_mode |= self.mask; dw_mode |= self.mask;
if !kernel::set_console_mode(&output_handle, dw_mode) if !kernel::set_console_mode(&output_handle, dw_mode)
{ {
panic!("Cannot get console mode");
return false; return false;
} }