diff options
author | Joris | 2025-02-06 19:10:54 +0100 |
---|---|---|
committer | Joris | 2025-02-06 19:10:54 +0100 |
commit | 2956aa5f5324e4183dbc87f81fbc71fd0f43dbf9 (patch) | |
tree | 41673ba3f942367a5548c1f05ef20a5e17bbba79 /src/controller/utils.rs | |
parent | c70e84a1b2aa307363b7b760f9f15b7438b0afba (diff) |
Improve String handling
See https://blog.sulami.xyz/posts/string-vs-str/
Diffstat (limited to 'src/controller/utils.rs')
-rw-r--r-- | src/controller/utils.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/controller/utils.rs b/src/controller/utils.rs index 340a5c7..ccef33c 100644 --- a/src/controller/utils.rs +++ b/src/controller/utils.rs @@ -71,8 +71,8 @@ fn server_error( ) } -pub fn text(str: String) -> Response<Full<Bytes>> { - let mut response = Response::new(str.into()); +pub fn text(str: impl Into<String>) -> Response<Full<Bytes>> { + let mut response = Response::new(str.into().into()); *response.status_mut() = StatusCode::OK; response } |