From 88a5b60fde5b2e8312b9536c5fc3227d3f7ca19c Mon Sep 17 00:00:00 2001 From: SegaraRai Date: Wed, 8 May 2024 00:32:58 +0900 Subject: [PATCH] chore: format --- src/capture.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/capture.rs b/src/capture.rs index 903f14b..7061b66 100644 --- a/src/capture.rs +++ b/src/capture.rs @@ -259,10 +259,10 @@ pub trait GraphicsCaptureApiHandler: Sized { Self::new(settings.flags).map_err(GraphicsCaptureApiError::NewHandlerError)?, )); - let item = match settings.item.try_into() { - Ok(item) => item, - Err(_) => return Err(GraphicsCaptureApiError::ItemConvertFailed), - }; + let item = settings + .item + .try_into() + .map_err(|_| GraphicsCaptureApiError::ItemConvertFailed)?; let mut capture = GraphicsCaptureApi::new( item, @@ -371,7 +371,9 @@ pub trait GraphicsCaptureApiHandler: Sized { Self::new(settings.flags).map_err(GraphicsCaptureApiError::NewHandlerError)?, )); - let item = settings.item.try_into() + let item = settings + .item + .try_into() .map_err(|_| GraphicsCaptureApiError::ItemConvertFailed)?; let mut capture = GraphicsCaptureApi::new(