Skip to content

Commit 51ea3b2

Browse files
authored
Avoid allocation when converting to axum's Response (#467)
1 parent 09b97ad commit 51ea3b2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

maud/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,10 @@ mod axum_support {
381381

382382
impl IntoResponse for PreEscaped<String> {
383383
fn into_response(self) -> Response {
384-
let mut headers = HeaderMap::new();
385-
headers.insert(
384+
let headers = [(
386385
header::CONTENT_TYPE,
387386
HeaderValue::from_static("text/html; charset=utf-8"),
388-
);
387+
)];
389388
(headers, self.0).into_response()
390389
}
391390
}

0 commit comments

Comments
 (0)