Ran cargo fmt

This commit is contained in:
2021-05-20 20:00:54 +02:00
parent b77c863065
commit 2699ddc5f8
2 changed files with 6 additions and 7 deletions

View File

@ -1,5 +1,5 @@
use std::fmt;
use std::borrow::Borrow;
use std::fmt;
#[derive(Copy, Clone)]
pub enum Kind {

View File

@ -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) {