From 35ee03cef2d78908e7d6771eb2735a93e4358a60 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 1 Aug 2023 23:45:53 +0200 Subject: Use my new “proxit” crate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main_result.rs | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 src/main_result.rs (limited to 'src/main_result.rs') diff --git a/src/main_result.rs b/src/main_result.rs deleted file mode 100644 index 36e3096..0000000 --- a/src/main_result.rs +++ /dev/null @@ -1,32 +0,0 @@ -use std::{ - io::{self, Write}, - process::{ExitCode, Termination}, -}; - -use super::error::Error; - -pub enum MainResult { - Success, - Failure(Error), -} - -impl Termination for MainResult { - fn report(self) -> ExitCode { - match self { - Self::Success => ExitCode::SUCCESS, - Self::Failure(e) => { - let _ = write!(io::stderr(), "{e}"); - ExitCode::FAILURE - } - } - } -} - -impl From> for MainResult { - fn from(r: Result<(), Error>) -> Self { - match r { - Ok(()) => Self::Success, - Err(e) => Self::Failure(e), - } - } -} -- cgit v1.2.3