Auto-reformat code
This commit is contained in:
parent
463bc99b9c
commit
1002782e8f
8 changed files with 41 additions and 33 deletions
src
|
@ -1,9 +1,10 @@
|
|||
use std::fmt::{Debug, Display, Formatter};
|
||||
|
||||
use crate::parameter::*;
|
||||
|
||||
pub mod channel;
|
||||
pub mod client;
|
||||
|
||||
use std::fmt::{Debug, Display, Formatter};
|
||||
use crate::parameter::*;
|
||||
|
||||
pub enum Response {
|
||||
Ok,
|
||||
Data(ParameterList),
|
||||
|
@ -25,8 +26,7 @@ impl TryFrom<String> for Response {
|
|||
response_str = response_str.trim_start_matches("error ");
|
||||
let response_params = parameter_parse(response_str);
|
||||
Err(ResponseError::create_error(&response_params))
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
let mut parameter_lists: Vec<ParameterList> = Vec::new();
|
||||
for response_entry in response_str.split('|') {
|
||||
let response_params = parameter_parse(response_entry);
|
||||
|
@ -39,23 +39,23 @@ impl TryFrom<String> for Response {
|
|||
|
||||
impl Debug for Response {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Response::Ok => {
|
||||
write!(f, "Ok")
|
||||
}
|
||||
Response::Data(params) => {
|
||||
write!(f, "Data:")?;
|
||||
match self {
|
||||
Response::Ok => {
|
||||
write!(f, "Ok")
|
||||
}
|
||||
Response::Data(params) => {
|
||||
write!(f, "Data:")?;
|
||||
write!(f, "{:?};", params)?;
|
||||
Ok(())
|
||||
}
|
||||
Response::DataList(params_list) => {
|
||||
write!(f, "DataList:")?;
|
||||
for params in params_list {
|
||||
write!(f, "{:?};", params)?;
|
||||
Ok(())
|
||||
}
|
||||
Response::DataList(params_list) => {
|
||||
write!(f, "DataList:")?;
|
||||
for params in params_list {
|
||||
write!(f, "{:?};", params)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue