From f90dd12efd808c8dcb354bb0667d63dd298cf00c Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Mon, 11 Oct 2021 00:54:18 +0000 Subject: Update rustfmt configuration In this change I went through all current rustfmt configuration options and expanded our existing configuration with overrides whenever deemed appropriate. The `normalize_doc_attributes` option is still unstable, but seems to work without any issues. Even when passing macros like `include_str!` that is recognized properly and not normalized. So while this wasn't an issue anywhere in the code, it should make sure it never will be. When it comes to imports there are two new major additions. The `imports_granularity` and `group_imports` options. Both mostly just incorporate unwritten rules that have existed in Alacritty for a long time. Unfortunately since `alacritty_terminal` imports in `alacritty` are supposed to be separate blocks, the `group_imports` option cannot be used. --- alacritty/src/panic.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'alacritty/src/panic.rs') diff --git a/alacritty/src/panic.rs b/alacritty/src/panic.rs index 9a76df72..2311d7b9 100644 --- a/alacritty/src/panic.rs +++ b/alacritty/src/panic.rs @@ -1,11 +1,13 @@ +use std::io::Write; +use std::{io, panic, ptr}; + +use winapi::um::winuser; + use alacritty_terminal::tty::windows::win32_string; // Install a panic handler that renders the panic in a classical Windows error // dialog box as well as writes the panic to STDERR. pub fn attach_handler() { - use std::{io, io::Write, panic, ptr}; - use winapi::um::winuser; - panic::set_hook(Box::new(|panic_info| { let _ = writeln!(io::stderr(), "{}", panic_info); let msg = format!("{}\n\nPress Ctrl-C to Copy", panic_info); -- cgit