From 10da30f540f76c10c7f029da1eec27439496f703 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Wed, 26 Jul 2023 18:26:24 +0000 Subject: Merge all `Destination` variants --- compiler/rustc_errors/src/emitter.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'compiler/rustc_errors') diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index cf456ebc8d5..b51ec3a8fcd 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -2604,7 +2604,6 @@ fn emit_to_destination( } pub enum Destination { - Terminal(StandardStream), Raw(Box<(dyn WriteColor + Send)>), } @@ -2649,7 +2648,7 @@ impl Destination { // On non-Windows we rely on the atomicity of `write` to ensure errors // don't get all jumbled up. if cfg!(windows) { - Terminal(StandardStream::stderr(choice)) + Raw(Box::new(StandardStream::stderr(choice))) } else { let buffer_writer = BufferWriter::stderr(choice); let buffer = buffer_writer.buffer(); @@ -2659,14 +2658,12 @@ impl Destination { fn writable(&mut self) -> &mut dyn WriteColor { match *self { - Destination::Terminal(ref mut t) => t, Destination::Raw(ref mut t) => t, } } fn supports_color(&self) -> bool { match *self { - Self::Terminal(ref stream) => stream.supports_color(), Self::Raw(ref writer) => writer.supports_color(), } } -- cgit 1.4.1-3-g733a5