cargo fmt

This commit is contained in:
ayham 2021-06-02 17:01:26 +03:00
parent 713bfdb6ff
commit bd35323627
Signed by: ayham
GPG Key ID: EAB7F5A9DF503678
6 changed files with 33 additions and 24 deletions

View File

@ -36,9 +36,9 @@ pub async fn acc_retrieve_portfolio(
) -> io::Result<Portfolio> {
if auth_jwt.is_empty() == true {
return Err(io::Error::new(
io::ErrorKind::PermissionDenied,
"ACC_RETRIEVE_PORTFOLIO: JWT TOKEN EMPTY"
));
io::ErrorKind::PermissionDenied,
"ACC_RETRIEVE_PORTFOLIO: JWT TOKEN EMPTY",
));
}
/* build message request */

View File

@ -37,9 +37,9 @@ pub async fn acc_retrieve_transaction(
) -> io::Result<Vec<Transaction>> {
if auth_jwt.is_empty() == true {
return Err(io::Error::new(
io::ErrorKind::PermissionDenied,
"ACC_RETRIEVE_TRANSACTION: JWT TOKEN EMPTY"
));
io::ErrorKind::PermissionDenied,
"ACC_RETRIEVE_TRANSACTION: JWT TOKEN EMPTY",
));
}
/* build message request */

View File

@ -57,16 +57,23 @@ pub async fn get_server_salt(
)
})?;
if assert_msg(&ret_msg, MessageType::DataTransfer,
true, 1,
false, 0,
true, 1,
true, digest::SHA512_OUTPUT_LEN / 2) {
if assert_msg(
&ret_msg,
MessageType::DataTransfer,
true,
1,
false,
0,
true,
1,
true,
digest::SHA512_OUTPUT_LEN / 2,
) {
Ok(*array_ref!(ret_msg.data, 0, digest::SHA512_OUTPUT_LEN / 2))
}
else {
Err(io::Error::new(io::ErrorKind::InvalidData,
format!("{}", ReturnFlags::ClientReqSaltInvMsg),
))
} else {
Err(io::Error::new(
io::ErrorKind::InvalidData,
format!("{}", ReturnFlags::ClientReqSaltInvMsg),
))
}
}

View File

@ -1,10 +1,10 @@
use std::io;
use std::net::ToSocketAddrs;
use std::path::PathBuf;
use std::sync::Arc;
use std::net::ToSocketAddrs;
use log::warn;
use argh::FromArgs;
use log::warn;
use tokio::io::AsyncReadExt;
use tokio::net::TcpListener;

View File

@ -1,5 +1,5 @@
use std::io;
use log::warn;
use std::io;
use crate::common::message::inst::DataTransferInst;
use crate::common::message::message::Message;
@ -42,8 +42,9 @@ pub async fn retrieve_portfolio(
Err(err) => {
warn!("RETRIEVE_PORTFOLIO_FAILED: {}", err);
Err(io::Error::new(
io::ErrorKind::Other,
format!("{}: {}", ReturnFlags::ServerRetrievePortfolioFailed, err)))
io::ErrorKind::Other,
format!("{}: {}", ReturnFlags::ServerRetrievePortfolioFailed, err),
))
}
}
}

View File

@ -1,5 +1,5 @@
use std::io;
use log::warn;
use std::io;
use crate::common::message::inst::DataTransferInst;
use crate::common::message::message::Message;
@ -43,8 +43,9 @@ pub async fn retrieve_transactions(
Err(err) => {
warn!("RETRIEVE_TRANSACTION_FAILED: {}", err);
Err(io::Error::new(
io::ErrorKind::Other,
format!("{}: {}", ReturnFlags::ServerRetrieveTransactionFailed, err)))
io::ErrorKind::Other,
format!("{}: {}", ReturnFlags::ServerRetrieveTransactionFailed, err),
))
}
}
}