mirror of
https://github.com/fafhrd91/actix-web
synced 2025-01-18 05:41:50 +01:00
code cleanup
This commit is contained in:
parent
d0b9d9c1d6
commit
29a26b3236
@ -244,9 +244,8 @@ impl<S> ApplicationBuilder<S> where S: 'static {
|
||||
routes.push((path, handler))
|
||||
}
|
||||
|
||||
for (path, mut handler) in parts.handlers {
|
||||
let path = prefix.clone() + path.trim_left_matches('/');
|
||||
handlers.insert(path, handler);
|
||||
for (path, handler) in parts.handlers {
|
||||
handlers.insert(prefix.clone() + path.trim_left_matches('/'), handler);
|
||||
}
|
||||
Application {
|
||||
state: Rc::new(parts.state),
|
||||
|
@ -168,10 +168,8 @@ impl From<FromUtf8Error> for ParseError {
|
||||
impl From<httparse::Error> for ParseError {
|
||||
fn from(err: httparse::Error) -> ParseError {
|
||||
match err {
|
||||
httparse::Error::HeaderName |
|
||||
httparse::Error::HeaderValue |
|
||||
httparse::Error::NewLine |
|
||||
httparse::Error::Token => ParseError::Header,
|
||||
httparse::Error::HeaderName | httparse::Error::HeaderValue |
|
||||
httparse::Error::NewLine | httparse::Error::Token => ParseError::Header,
|
||||
httparse::Error::Status => ParseError::Status,
|
||||
httparse::Error::TooManyHeaders => ParseError::TooLarge,
|
||||
httparse::Error::Version => ParseError::Version,
|
||||
|
Loading…
x
Reference in New Issue
Block a user