aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/tty
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2021-10-11 00:54:18 +0000
committerGitHub <noreply@github.com>2021-10-11 00:54:18 +0000
commitf90dd12efd808c8dcb354bb0667d63dd298cf00c (patch)
treed9c0269b1b764f58d942f28223ec19d2fff7e42d /alacritty_terminal/src/tty
parentec4dc32688cfc71686c24a4edc59fd7427a6bf33 (diff)
downloadalacritty-f90dd12efd808c8dcb354bb0667d63dd298cf00c.tar.gz
alacritty-f90dd12efd808c8dcb354bb0667d63dd298cf00c.zip
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.
Diffstat (limited to 'alacritty_terminal/src/tty')
-rw-r--r--alacritty_terminal/src/tty/unix.rs12
-rw-r--r--alacritty_terminal/src/tty/windows/conpty.rs4
2 files changed, 6 insertions, 10 deletions
diff --git a/alacritty_terminal/src/tty/unix.rs b/alacritty_terminal/src/tty/unix.rs
index a3c35f95..483333e7 100644
--- a/alacritty_terminal/src/tty/unix.rs
+++ b/alacritty_terminal/src/tty/unix.rs
@@ -5,15 +5,12 @@ use std::borrow::Cow;
use std::env;
use std::ffi::CStr;
use std::fs::File;
-use std::io;
use std::mem::MaybeUninit;
-use std::os::unix::{
- io::{AsRawFd, FromRawFd, RawFd},
- process::CommandExt,
-};
+use std::os::unix::io::{AsRawFd, FromRawFd, RawFd};
+use std::os::unix::process::CommandExt;
use std::process::{Child, Command, Stdio};
-use std::ptr;
use std::sync::atomic::{AtomicI32, AtomicUsize, Ordering};
+use std::{io, ptr};
use libc::{self, c_int, pid_t, winsize, TIOCSCTTY};
use log::error;
@@ -21,7 +18,8 @@ use mio::unix::EventedFd;
use nix::pty::openpty;
#[cfg(any(target_os = "linux", target_os = "macos"))]
use nix::sys::termios::{self, InputFlags, SetArg};
-use signal_hook::{self as sighook, iterator::Signals};
+use signal_hook as sighook;
+use signal_hook::iterator::Signals;
use crate::config::{Config, Program};
use crate::event::OnResize;
diff --git a/alacritty_terminal/src/tty/windows/conpty.rs b/alacritty_terminal/src/tty/windows/conpty.rs
index 919bd00f..002022ea 100644
--- a/alacritty_terminal/src/tty/windows/conpty.rs
+++ b/alacritty_terminal/src/tty/windows/conpty.rs
@@ -1,8 +1,6 @@
-use std::i16;
use std::io::Error;
-use std::mem;
use std::os::windows::io::IntoRawHandle;
-use std::ptr;
+use std::{i16, mem, ptr};
use mio_anonymous_pipes::{EventedAnonRead, EventedAnonWrite};
use winapi::shared::basetsd::{PSIZE_T, SIZE_T};