Simplify boolean expression

This commit is contained in:
Rob Wagner 2023-10-23 21:05:57 -04:00
parent 3928b9f407
commit 0156ceb268
No known key found for this signature in database
GPG key ID: 53CCB4497B15CF61

View file

@ -104,9 +104,10 @@ impl IntoResponseParts for HxRefresh {
fn into_response_parts(self, mut res: ResponseParts) -> Result<ResponseParts, Self::Error> { fn into_response_parts(self, mut res: ResponseParts) -> Result<ResponseParts, Self::Error> {
res.headers_mut().insert( res.headers_mut().insert(
headers::HX_REFRESH, headers::HX_REFRESH,
match self.0 { if self.0 {
true => HeaderValue::from_static("true"), HeaderValue::from_static("true")
false => HeaderValue::from_static("false"), } else {
HeaderValue::from_static("false")
}, },
); );