Fix unused import on windows

This commit is contained in:
Alexandre Bury 2021-04-10 23:42:40 -07:00
parent 3c7386dd50
commit cc1f57b4bf

View File

@ -6,7 +6,6 @@
use std::{ use std::{
cell::{Cell, RefCell, RefMut}, cell::{Cell, RefCell, RefMut},
fs::File,
io::{self, BufWriter, Write}, io::{self, BufWriter, Write},
time::Duration, time::Duration,
}; };
@ -42,7 +41,7 @@ use crate::{
type Stdout = io::Stdout; type Stdout = io::Stdout;
#[cfg(unix)] #[cfg(unix)]
type Stdout = File; type Stdout = std::fs::File;
/// Backend using crossterm /// Backend using crossterm
pub struct Backend { pub struct Backend {
@ -205,7 +204,8 @@ impl Backend {
)?; )?;
#[cfg(unix)] #[cfg(unix)]
let stdout = RefCell::new(BufWriter::new(File::create("/dev/tty")?)); let stdout =
RefCell::new(BufWriter::new(std::fs::File::create("/dev/tty")?));
#[cfg(windows)] #[cfg(windows)]
let stdout = RefCell::new(BufWriter::new(io::stdout())); let stdout = RefCell::new(BufWriter::new(io::stdout()));