Cargo fmt fix

This commit is contained in:
Prabhpreet Dua
2024-04-15 22:13:14 +05:30
parent b56af8b696
commit 15aafe7563
3 changed files with 20 additions and 17 deletions

View File

@@ -507,7 +507,7 @@ impl AppServer {
non_blocking_polls_count: 0, non_blocking_polls_count: 0,
unpolled_count: 0, unpolled_count: 0,
last_update_time: Instant::now(), last_update_time: Instant::now(),
test_flags test_flags,
}) })
} }

View File

@@ -6,8 +6,8 @@ use rosenpass_secret_memory::file::StoreSecret;
use rosenpass_util::file::{LoadValue, LoadValueB64}; use rosenpass_util::file::{LoadValue, LoadValueB64};
use std::path::PathBuf; use std::path::PathBuf;
use crate::app_server::{self, AppServerTestFlags};
use crate::app_server::AppServer; use crate::app_server::AppServer;
use crate::app_server::{self, AppServerTestFlags};
use crate::protocol::{SPk, SSk, SymKey}; use crate::protocol::{SPk, SSk, SymKey};
use super::config; use super::config;
@@ -307,7 +307,7 @@ impl CliCommand {
pk, pk,
config.listen, config.listen,
config.verbosity, config.verbosity,
test_flags test_flags,
)?); )?);
for cfg_peer in config.peers { for cfg_peer in config.peers {

View File

@@ -166,7 +166,8 @@ fn check_exchange_under_dos() {
let mut server_cmd = std::process::Command::new(BIN); let mut server_cmd = std::process::Command::new(BIN);
server_cmd.args(["exchange", "secret-key"]) server_cmd
.args(["exchange", "secret-key"])
.arg(&secret_key_paths[0]) .arg(&secret_key_paths[0])
.arg("public-key") .arg("public-key")
.arg(&public_key_paths[0]) .arg(&public_key_paths[0])
@@ -175,22 +176,24 @@ fn check_exchange_under_dos() {
.arg("outfile") .arg("outfile")
.arg(&shared_key_paths[0]); .arg(&shared_key_paths[0]);
let server_cmd: Vec<String> =
let server_cmd: Vec<String> = server_cmd server_cmd
.get_args() .get_args()
.into_iter() .into_iter()
.fold(vec![BIN.to_string()], |mut acc, x| { .fold(vec![BIN.to_string()], |mut acc, x| {
if let Some(s) = x.to_str() { if let Some(s) = x.to_str() {
acc.push(s.to_string()); acc.push(s.to_string());
} }
acc acc
}); });
let mut server = procspawn::spawn(server_cmd, |server_cmd: Vec<String>| { let mut server = procspawn::spawn(server_cmd, |server_cmd: Vec<String>| {
let cli = CliArgs::try_parse_from(server_cmd.iter()).unwrap(); let cli = CliArgs::try_parse_from(server_cmd.iter()).unwrap();
cli.command.run(AppServerTestFlags { cli.command
enable_dos_permanently: true, .run(AppServerTestFlags {
}).unwrap(); enable_dos_permanently: true,
})
.unwrap();
}); });
// start second process, the client // start second process, the client