Skip to content

Commit 339890e

Browse files
committed
Remove an enum variant that can be covered by another
1 parent 51c2215 commit 339890e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

compiler/rustc_errors/src/emitter.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -2609,7 +2609,6 @@ pub enum Destination {
26092609
}
26102610

26112611
pub enum WritableDst<'a> {
2612-
Terminal(&'a mut StandardStream),
26132612
Buffered(&'a mut BufferWriter, Buffer),
26142613
Raw(&'a mut (dyn WriteColor + Send)),
26152614
}
@@ -2632,7 +2631,7 @@ impl Destination {
26322631

26332632
fn writable(&mut self) -> WritableDst<'_> {
26342633
match *self {
2635-
Destination::Terminal(ref mut t) => WritableDst::Terminal(t),
2634+
Destination::Terminal(ref mut t) => WritableDst::Raw(t),
26362635
Destination::Buffered(ref mut t) => {
26372636
let buf = t.buffer();
26382637
WritableDst::Buffered(t, buf)
@@ -2703,15 +2702,13 @@ impl<'a> WritableDst<'a> {
27032702

27042703
fn set_color(&mut self, color: &ColorSpec) -> io::Result<()> {
27052704
match *self {
2706-
WritableDst::Terminal(ref mut t) => t.set_color(color),
27072705
WritableDst::Buffered(_, ref mut t) => t.set_color(color),
27082706
WritableDst::Raw(ref mut t) => t.set_color(color),
27092707
}
27102708
}
27112709

27122710
fn reset(&mut self) -> io::Result<()> {
27132711
match *self {
2714-
WritableDst::Terminal(ref mut t) => t.reset(),
27152712
WritableDst::Buffered(_, ref mut t) => t.reset(),
27162713
WritableDst::Raw(ref mut t) => t.reset(),
27172714
}
@@ -2721,15 +2718,13 @@ impl<'a> WritableDst<'a> {
27212718
impl<'a> Write for WritableDst<'a> {
27222719
fn write(&mut self, bytes: &[u8]) -> io::Result<usize> {
27232720
match *self {
2724-
WritableDst::Terminal(ref mut t) => t.write(bytes),
27252721
WritableDst::Buffered(_, ref mut buf) => buf.write(bytes),
27262722
WritableDst::Raw(ref mut w) => w.write(bytes),
27272723
}
27282724
}
27292725

27302726
fn flush(&mut self) -> io::Result<()> {
27312727
match *self {
2732-
WritableDst::Terminal(ref mut t) => t.flush(),
27332728
WritableDst::Buffered(_, ref mut buf) => buf.flush(),
27342729
WritableDst::Raw(ref mut w) => w.flush(),
27352730
}

0 commit comments

Comments
 (0)