From d31a97811b94fa4403939c289eaf98eaca237b0e Mon Sep 17 00:00:00 2001 From: Ben Bridle Date: Thu, 31 Oct 2024 17:44:28 +1300 Subject: Suppress errors when flushing file and stream data File and stream data is flushed on drop, and if flushing fails a panic is thrown, which prints a crash message to the terminal. Since we can't do anything if the write fails, and because file and stream writes are approached with a best-effort attitude, we suppress the errors to prevent the user from seeing them and getting concerned. --- src/devices/local_device.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/devices/local_device.rs') diff --git a/src/devices/local_device.rs b/src/devices/local_device.rs index fa19de7..c6456de 100644 --- a/src/devices/local_device.rs +++ b/src/devices/local_device.rs @@ -162,7 +162,7 @@ impl LocalDevice { } pub fn flush(&mut self) { - self.stdout.flush().unwrap(); + let _ = self.stdout.flush(); } } -- cgit v1.2.3-70-g09d2