Skip to content

Commit 9a7598b

Browse files
committed
clippy
1 parent c921065 commit 9a7598b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎src/app_config.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,10 @@ fn deserialize_socket_addr<'de, D: Deserializer<'de>>(
152152
/// The site prefix should always start and end with a `/`.
153153
fn deserialize_site_prefix<'de, D: Deserializer<'de>>(deserializer: D) -> Result<String, D::Error> {
154154
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()))
155+
Ok(prefix.map_or_else(
156+
|| '/'.to_string(),
157+
|h| '/'.to_string() + h.trim_start_matches('/').trim_end_matches('/') + "/",
158+
))
158159
}
159160

160161
fn parse_socket_addr(host_str: &str) -> anyhow::Result<SocketAddr> {

0 commit comments

Comments
 (0)