There was an error while loading. Please reload this page.
1 parent c921065 commit 9a7598bCopy full SHA for 9a7598b
src/app_config.rs
@@ -152,9 +152,10 @@ fn deserialize_socket_addr<'de, D: Deserializer<'de>>(
152
/// The site prefix should always start and end with a `/`.
153
fn deserialize_site_prefix<'de, D: Deserializer<'de>>(deserializer: D) -> Result<String, D::Error> {
154
let prefix: Option<String> = Deserialize::deserialize(deserializer)?;
155
- Ok(prefix
156
- .map(|h| "/".to_string() + h.trim_start_matches('/').trim_end_matches('/') + "/")
157
- .unwrap_or_else(|| "/".to_string()))
+ Ok(prefix.map_or_else(
+ || '/'.to_string(),
+ |h| '/'.to_string() + h.trim_start_matches('/').trim_end_matches('/') + "/",
158
+ ))
159
}
160
161
fn parse_socket_addr(host_str: &str) -> anyhow::Result<SocketAddr> {
0 commit comments