Ran cargo fmt
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
use std::fmt;
|
||||
use std::borrow::Borrow;
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum Kind {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use super::Method;
|
||||
use crate::error::*;
|
||||
use crate::usimp;
|
||||
use crate::websocket;
|
||||
use crate::error::*;
|
||||
use serde_json;
|
||||
|
||||
pub struct HttpStream {
|
||||
@ -132,8 +132,9 @@ fn endpoint_handler(
|
||||
Ok(length) => length,
|
||||
Err(e) => {
|
||||
return error(
|
||||
Error::new(Kind::HttpRequestParseError, Class::ClientError)
|
||||
.set_desc(format!("unable to parse field 'Content-Length': {}", &e).to_string()),
|
||||
Error::new(Kind::HttpRequestParseError, Class::ClientError).set_desc(
|
||||
format!("unable to parse field 'Content-Length': {}", &e).to_string(),
|
||||
),
|
||||
client,
|
||||
)
|
||||
}
|
||||
@ -145,9 +146,7 @@ fn endpoint_handler(
|
||||
// TODO decompress
|
||||
let input = match serde_json::from_slice(&buf[..length]) {
|
||||
Ok(val) => val,
|
||||
Err(e) => {
|
||||
return error(e.into(), client)
|
||||
}
|
||||
Err(e) => return error(e.into(), client),
|
||||
};
|
||||
|
||||
let buf = match usimp::endpoint(endpoint, input) {
|
||||
|
Reference in New Issue
Block a user