From 72e1a40babf4bd4cdad4630b996d6f7c4d32681d Mon Sep 17 00:00:00 2001 From: Peter Hebden Date: Sun, 9 Jul 2023 02:00:01 +0100 Subject: [PATCH] Remove leftover unwrap --- src/controller.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/controller.rs b/src/controller.rs index e8b32bc8..42c13936 100644 --- a/src/controller.rs +++ b/src/controller.rs @@ -79,11 +79,10 @@ impl<'b> Controller<'b> { clircle::Identifier::stdout() }; - //let writer = output_type.handle()?; - let mut writer = output_buffer.map_or_else( - || OutputHandle::IoWrite(output_type.handle().unwrap()), - |buf| OutputHandle::FmtWrite(buf), - ); + let mut writer = match output_buffer { + Some(buf) => OutputHandle::FmtWrite(buf), + None => OutputHandle::IoWrite(output_type.handle()?), + }; let mut no_errors: bool = true; let stderr = io::stderr();