Skip to content

Commit 5977848

Browse files
committed
refactor logger flushing
1 parent 799ec79 commit 5977848

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

crates/rust-analyzer/src/bin/logger.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use std::{
66
fs::File,
7-
io::{self, BufWriter, Write},
7+
io::{BufWriter, Write},
88
};
99

1010
use env_logger::filter::{Builder, Filter};
@@ -75,13 +75,6 @@ impl Log for Logger {
7575
}
7676

7777
fn flush(&self) {
78-
match &self.file {
79-
Some(w) => {
80-
let _ = w.lock().flush();
81-
}
82-
None => {
83-
let _ = io::stderr().flush();
84-
}
85-
}
78+
self.file.as_ref().unwrap().lock().flush().unwrap();
8679
}
8780
}

0 commit comments

Comments
 (0)