Skip to content

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntSushi committed Sep 9, 2016
1 parent 48878bb commit cc6b6dc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/out.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ use term::WinConsole;

use terminal::TerminfoTerminal;

pub type StdoutTerminal = Box<Terminal<Output=io::BufWriter<io::Stdout>> + Send>;
pub type StdoutTerminal = Box<Terminal<Output=io::Stdout> + Send>;

/// Gets a terminal that supports color if available.
#[cfg(windows)]
fn term_stdout(color: bool) -> StdoutTerminal {
let stdout = io::BufWriter::new(io::stdout());
let stdout = io::stdout();
WinConsole::new(stdout)
.ok()
.map(|t| Box::new(t))
.map(|t| Box::new(t) as StdoutTerminal)
.unwrap_or_else(|| {
let stdout = io::BufWriter::new(io::stdout());
Box::new(NoColorTerminal::new(stdout))
let stdout = io::stdout();
Box::new(NoColorTerminal::new(stdout)) as StdoutTerminal
})
}

/// Gets a terminal that supports color if available.
#[cfg(not(windows))]
fn term_stdout(color: bool) -> StdoutTerminal {
let stdout = io::BufWriter::new(io::stdout());
let stdout = io::stdout();
if !color || TERMINFO.is_none() {
Box::new(NoColorTerminal::new(stdout))
} else {
Expand Down

0 comments on commit cc6b6dc

Please sign in to comment.