mirror of
https://github.com/fafhrd91/actix-web
synced 2025-07-01 16:55:08 +02:00
use const header values where possible
This commit is contained in:
@ -99,8 +99,9 @@ impl From<HandshakeError> for Response<BoxBody> {
|
||||
match err {
|
||||
HandshakeError::GetMethodRequired => {
|
||||
let mut res = Response::new(StatusCode::METHOD_NOT_ALLOWED);
|
||||
res.headers_mut()
|
||||
.insert(header::ALLOW, HeaderValue::from_static("GET"));
|
||||
#[allow(clippy::declare_interior_mutable_const)]
|
||||
const HV_GET: HeaderValue = HeaderValue::from_static("GET");
|
||||
res.headers_mut().insert(header::ALLOW, HV_GET);
|
||||
res
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user