From 035c9c0e5e6c35ff046068949aeb4acb9a0d7a65 Mon Sep 17 00:00:00 2001 From: Rob Wagner Date: Sun, 3 Dec 2023 15:50:40 -0500 Subject: [PATCH] Minor stylistic tweaks --- src/extractors.rs | 1 + src/responders/location.rs | 1 + src/responders/trigger.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/extractors.rs b/src/extractors.rs index bb366f1..f7a3de6 100644 --- a/src/extractors.rs +++ b/src/extractors.rs @@ -60,6 +60,7 @@ where .to_str() .ok() .and_then(|url| url.parse::().ok()); + return Ok(HxCurrentUrl(url)); } diff --git a/src/responders/location.rs b/src/responders/location.rs index 39b5a7d..c7ff3ca 100644 --- a/src/responders/location.rs +++ b/src/responders/location.rs @@ -83,6 +83,7 @@ impl HxLocation { path: self.uri.to_string(), opts: self.options, }; + Ok(serde_json::to_string(&loc_with_opts)?) } } diff --git a/src/responders/trigger.rs b/src/responders/trigger.rs index e96440b..393d1a0 100644 --- a/src/responders/trigger.rs +++ b/src/responders/trigger.rs @@ -57,6 +57,7 @@ fn events_to_header_value(events: Vec) -> Result>() .join(", "); + http::HeaderValue::from_str(&header).map_err(Into::into) }