Skip to content

Commit

Permalink
style: switch to rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntSushi committed Jan 11, 2020
1 parent 322ffeb commit 4e61b68
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 2 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
max_width = 79
use_small_heuristics = "max"
2 changes: 1 addition & 1 deletion src/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 2 additions & 5 deletions src/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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: AsHandleRef>(
h: H,
) -> io::Result<Information> {
pub fn information<H: AsHandleRef>(h: H) -> io::Result<Information> {
unsafe {
let mut info: BY_HANDLE_FILE_INFORMATION = mem::zeroed();
let rc = GetFileInformationByHandle(h.as_raw(), &mut info);
Expand Down
3 changes: 1 addition & 2 deletions src/win.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 4e61b68

Please sign in to comment.