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::borrow::Borrow;
use std::fmt;
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub enum Kind { pub enum Kind {

View File

@ -1,7 +1,7 @@
use super::Method; use super::Method;
use crate::error::*;
use crate::usimp; use crate::usimp;
use crate::websocket; use crate::websocket;
use crate::error::*;
use serde_json; use serde_json;
pub struct HttpStream { pub struct HttpStream {
@ -132,8 +132,9 @@ fn endpoint_handler(
Ok(length) => length, Ok(length) => length,
Err(e) => { Err(e) => {
return error( return error(
Error::new(Kind::HttpRequestParseError, Class::ClientError) Error::new(Kind::HttpRequestParseError, Class::ClientError).set_desc(
.set_desc(format!("unable to parse field 'Content-Length': {}", &e).to_string()), format!("unable to parse field 'Content-Length': {}", &e).to_string(),
),
client, client,
) )
} }
@ -145,9 +146,7 @@ fn endpoint_handler(
// TODO decompress // TODO decompress
let input = match serde_json::from_slice(&buf[..length]) { let input = match serde_json::from_slice(&buf[..length]) {
Ok(val) => val, Ok(val) => val,
Err(e) => { Err(e) => return error(e.into(), client),
return error(e.into(), client)
}
}; };
let buf = match usimp::endpoint(endpoint, input) { let buf = match usimp::endpoint(endpoint, input) {