Minor stylistic tweaks

This commit is contained in:
Rob Wagner 2023-12-03 15:50:40 -05:00
parent 97b72850f5
commit 035c9c0e5e
No known key found for this signature in database
GPG key ID: 53CCB4497B15CF61
3 changed files with 3 additions and 0 deletions

View file

@ -60,6 +60,7 @@ where
.to_str() .to_str()
.ok() .ok()
.and_then(|url| url.parse::<http::Uri>().ok()); .and_then(|url| url.parse::<http::Uri>().ok());
return Ok(HxCurrentUrl(url)); return Ok(HxCurrentUrl(url));
} }

View file

@ -83,6 +83,7 @@ impl HxLocation {
path: self.uri.to_string(), path: self.uri.to_string(),
opts: self.options, opts: self.options,
}; };
Ok(serde_json::to_string(&loc_with_opts)?) Ok(serde_json::to_string(&loc_with_opts)?)
} }
} }

View file

@ -57,6 +57,7 @@ fn events_to_header_value(events: Vec<HxEvent>) -> Result<http::HeaderValue, HxE
.map(|HxEvent { name }| name) .map(|HxEvent { name }| name)
.collect::<Vec<_>>() .collect::<Vec<_>>()
.join(", "); .join(", ");
http::HeaderValue::from_str(&header).map_err(Into::into) http::HeaderValue::from_str(&header).map_err(Into::into)
} }