Skip to content

Commit 85b4dab

Browse files
committed
remove format!()
1 parent 44bbff1 commit 85b4dab

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/webserver/routing.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ where
4444
C: RoutingConfig,
4545
{
4646
if uri.path().starts_with(config.prefix().path()) {
47-
Ok(PathBuf::from(format!(
48-
"/{}",
47+
let mut result = String::from("/");
48+
result.push_str(
4949
uri.path()
5050
.strip_prefix(config.prefix().path())
51-
.expect("Unable to remove expected prefix from path")
52-
)))
51+
.expect("Unable to remove expected prefix from path"),
52+
);
53+
54+
Ok(PathBuf::from(result))
5355
} else {
5456
Err(Redirect(config.prefix().clone()))
5557
}

0 commit comments

Comments
 (0)