From 4e61b68ff10d979b6d9a46e74c9b1c4ed7d07560 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sat, 11 Jan 2020 08:53:03 -0500 Subject: [PATCH] style: switch to rustfmt --- rustfmt.toml | 2 ++ src/console.rs | 2 +- src/file.rs | 7 ++----- src/win.rs | 3 +-- 4 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 rustfmt.toml diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..aa37a21 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,2 @@ +max_width = 79 +use_small_heuristics = "max" diff --git a/src/console.rs b/src/console.rs index ac38aea..f85928e 100644 --- a/src/console.rs +++ b/src/console.rs @@ -3,8 +3,8 @@ use std::mem; use winapi::um::consoleapi::{GetConsoleMode, SetConsoleMode}; use winapi::um::wincon::{ - CONSOLE_SCREEN_BUFFER_INFO, GetConsoleScreenBufferInfo, SetConsoleTextAttribute, + CONSOLE_SCREEN_BUFFER_INFO, }; use crate::AsHandleRef; diff --git a/src/file.rs b/src/file.rs index ceb51ef..56a1e41 100644 --- a/src/file.rs +++ b/src/file.rs @@ -5,8 +5,7 @@ use winapi::shared::minwindef::FILETIME; use winapi::shared::winerror::NO_ERROR; use winapi::um::errhandlingapi::GetLastError; use winapi::um::fileapi::{ - BY_HANDLE_FILE_INFORMATION, - GetFileInformationByHandle, GetFileType, + GetFileInformationByHandle, GetFileType, BY_HANDLE_FILE_INFORMATION, }; use winapi::um::winnt; @@ -20,9 +19,7 @@ use crate::AsHandleRef; /// This corresponds to calling [`GetFileInformationByHandle`]. /// /// [`GetFileInformationByHandle`]: https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle -pub fn information( - h: H, -) -> io::Result { +pub fn information(h: H) -> io::Result { unsafe { let mut info: BY_HANDLE_FILE_INFORMATION = mem::zeroed(); let rc = GetFileInformationByHandle(h.as_raw(), &mut info); diff --git a/src/win.rs b/src/win.rs index 490534b..9c77c0d 100644 --- a/src/win.rs +++ b/src/win.rs @@ -1,8 +1,7 @@ use std::fs::File; use std::io; use std::os::windows::io::{ - RawHandle, - AsRawHandle, FromRawHandle, IntoRawHandle, + AsRawHandle, FromRawHandle, IntoRawHandle, RawHandle, }; use std::path::Path; use std::process;