From 0156ceb268a16644cee5ee9f54c59ce45adf625c Mon Sep 17 00:00:00 2001 From: Rob Wagner Date: Mon, 23 Oct 2023 21:05:57 -0400 Subject: [PATCH] Simplify boolean expression --- src/responders.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/responders.rs b/src/responders.rs index 4352fd7..e41331b 100644 --- a/src/responders.rs +++ b/src/responders.rs @@ -104,9 +104,10 @@ impl IntoResponseParts for HxRefresh { fn into_response_parts(self, mut res: ResponseParts) -> Result { res.headers_mut().insert( headers::HX_REFRESH, - match self.0 { - true => HeaderValue::from_static("true"), - false => HeaderValue::from_static("false"), + if self.0 { + HeaderValue::from_static("true") + } else { + HeaderValue::from_static("false") }, );