mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
Run cargo fmt
This commit is contained in:
parent
e3ce111548
commit
f18fc52675
10 changed files with 17 additions and 19 deletions
|
|
@ -2,9 +2,9 @@ use std::fs::File;
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
|
use aquatic_toml_config::TomlConfig;
|
||||||
use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
use serde::{de::DeserializeOwned, Deserialize, Serialize};
|
||||||
use simplelog::{ColorChoice, ConfigBuilder, LevelFilter, TermLogger, TerminalMode};
|
use simplelog::{ColorChoice, ConfigBuilder, LevelFilter, TermLogger, TerminalMode};
|
||||||
use aquatic_toml_config::TomlConfig;
|
|
||||||
|
|
||||||
/// Log level. Available values are off, error, warn, info, debug and trace.
|
/// Log level. Available values are off, error, warn, info, debug and trace.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, TomlConfig, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Copy, PartialEq, TomlConfig, Serialize, Deserialize)]
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ use std::path::PathBuf;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
|
use aquatic_toml_config::TomlConfig;
|
||||||
use arc_swap::{ArcSwap, Cache};
|
use arc_swap::{ArcSwap, Cache};
|
||||||
use hashbrown::HashSet;
|
use hashbrown::HashSet;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use aquatic_toml_config::TomlConfig;
|
|
||||||
|
|
||||||
/// Access list mode. Available modes are white, black and off.
|
/// Access list mode. Available modes are white, black and off.
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, TomlConfig, Serialize, Deserialize)]
|
#[derive(Clone, Copy, Debug, PartialEq, TomlConfig, Serialize, Deserialize)]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
use aquatic_toml_config::TomlConfig;
|
||||||
use hwloc::{CpuSet, ObjectType, Topology, CPUBIND_THREAD};
|
use hwloc::{CpuSet, ObjectType, Topology, CPUBIND_THREAD};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use aquatic_toml_config::TomlConfig;
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, TomlConfig, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, TomlConfig, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
|
|
|
||||||
|
|
@ -52,16 +52,14 @@ where
|
||||||
if peer_map_len <= max_num_peers_to_take + 1 {
|
if peer_map_len <= max_num_peers_to_take + 1 {
|
||||||
let mut peers = Vec::with_capacity(peer_map_len);
|
let mut peers = Vec::with_capacity(peer_map_len);
|
||||||
|
|
||||||
peers.extend(peer_map
|
peers.extend(peer_map.iter().filter_map(|(k, v)| {
|
||||||
.iter()
|
if *k == sender_peer_map_key {
|
||||||
.filter_map(|(k, v)| {
|
None
|
||||||
if *k == sender_peer_map_key {
|
} else {
|
||||||
None
|
Some(peer_conversion_function(v))
|
||||||
} else {
|
}
|
||||||
Some(peer_conversion_function(v))
|
}));
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
peers
|
peers
|
||||||
} else {
|
} else {
|
||||||
let half_num_to_take = max_num_peers_to_take / 2;
|
let half_num_to_take = max_num_peers_to_take / 2;
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ use std::{
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use aquatic_toml_config::TomlConfig;
|
||||||
use privdrop::PrivDrop;
|
use privdrop::PrivDrop;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use aquatic_toml_config::TomlConfig;
|
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
use std::{net::SocketAddr, path::PathBuf};
|
use std::{net::SocketAddr, path::PathBuf};
|
||||||
|
|
||||||
use aquatic_common::{access_list::AccessListConfig, privileges::PrivilegeConfig};
|
use aquatic_common::{access_list::AccessListConfig, privileges::PrivilegeConfig};
|
||||||
use serde::Deserialize;
|
|
||||||
use aquatic_toml_config::TomlConfig;
|
use aquatic_toml_config::TomlConfig;
|
||||||
|
use serde::Deserialize;
|
||||||
|
|
||||||
use aquatic_cli_helpers::LogLevel;
|
use aquatic_cli_helpers::LogLevel;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
|
|
||||||
use aquatic_cli_helpers::LogLevel;
|
use aquatic_cli_helpers::LogLevel;
|
||||||
use serde::Deserialize;
|
|
||||||
use aquatic_toml_config::TomlConfig;
|
use aquatic_toml_config::TomlConfig;
|
||||||
|
use serde::Deserialize;
|
||||||
|
|
||||||
/// aquatic_http_load_test configuration
|
/// aquatic_http_load_test configuration
|
||||||
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
pub use toml;
|
|
||||||
pub use aquatic_toml_config_derive::TomlConfig;
|
pub use aquatic_toml_config_derive::TomlConfig;
|
||||||
|
pub use toml;
|
||||||
|
|
||||||
/// Run this on your struct implementing TomlConfig to generate a
|
/// Run this on your struct implementing TomlConfig to generate a
|
||||||
/// serialization/deserialization test for it.
|
/// serialization/deserialization test for it.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
use serde::Deserialize;
|
|
||||||
use aquatic_toml_config::TomlConfig;
|
use aquatic_toml_config::TomlConfig;
|
||||||
|
use serde::Deserialize;
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
||||||
pub struct BenchConfig {
|
pub struct BenchConfig {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ use std::net::SocketAddr;
|
||||||
use aquatic_cli_helpers::LogLevel;
|
use aquatic_cli_helpers::LogLevel;
|
||||||
#[cfg(feature = "cpu-pinning")]
|
#[cfg(feature = "cpu-pinning")]
|
||||||
use aquatic_common::cpu_pinning::CpuPinningConfig;
|
use aquatic_common::cpu_pinning::CpuPinningConfig;
|
||||||
use serde::Deserialize;
|
|
||||||
use aquatic_toml_config::TomlConfig;
|
use aquatic_toml_config::TomlConfig;
|
||||||
|
use serde::Deserialize;
|
||||||
|
|
||||||
/// aquatic_ws_load_test configuration
|
/// aquatic_ws_load_test configuration
|
||||||
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, TomlConfig, Deserialize)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue