Skip to content

Commit

Permalink
Simplify use clauses for importing common / public definitions. (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
r12f committed Jul 25, 2021
1 parent da2dfdd commit 1c4d3d5
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/ping_clients/ping_client_factory.rs
@@ -1,5 +1,5 @@
use crate::ping_clients::ping_client_tcp::PingClientTcp;
use crate::{ExternalPingClientFactory, PingClient, PingClientConfig, RnpSupportedProtocol};
use crate::*;

#[cfg(any(not(target_os = "windows"), not(target_arch = "aarch64")))]
use crate::ping_clients::ping_client_quic::PingClientQuic;
Expand Down
5 changes: 1 addition & 4 deletions src/ping_clients/ping_client_quic.rs
@@ -1,7 +1,4 @@
use crate::ping_clients::ping_client::{
PingClient, PingClientError, PingClientPingResultDetails, PingClientResult, PingClientWarning,
};
use crate::PingClientConfig;
use crate::*;
use async_trait::async_trait;
use quinn::{ClientConfigBuilder, ConnectionError, Endpoint, EndpointError};
use rustls::ServerCertVerified;
Expand Down
5 changes: 1 addition & 4 deletions src/ping_clients/ping_client_tcp.rs
@@ -1,7 +1,4 @@
use crate::ping_clients::ping_client::{
PingClient, PingClientError, PingClientPingResultDetails, PingClientResult, PingClientWarning,
};
use crate::PingClientConfig;
use crate::*;
use async_trait::async_trait;
use socket2::{Domain, SockAddr, Socket, Type};
use std::io;
Expand Down
2 changes: 1 addition & 1 deletion src/ping_clients/ping_client_test_common.rs
@@ -1,4 +1,4 @@
use crate::ping_clients::ping_client::PingClient;
use crate::*;
use pretty_assertions::assert_eq;
use std::net::SocketAddr;
use std::time::Duration;
Expand Down
@@ -1,6 +1,4 @@
use crate::ping_clients::ping_client::PingClientWarning;
use crate::ping_result_processors::ping_result_processor::PingResultProcessor;
use crate::PingResult;
use crate::*;
use std::io::{stdout, Write};
use std::net::SocketAddr;
use std::time::Instant;
Expand Down
@@ -1,5 +1,4 @@
use crate::ping_result_processors::ping_result_processor::PingResultProcessor;
use crate::{rnp_utils, PingResult};
use crate::*;
use std::{fs::File, io, io::prelude::*, path::PathBuf};
use tracing;

Expand Down
@@ -1,5 +1,4 @@
use crate::ping_result_processors::ping_result_processor::PingResultProcessor;
use crate::{rnp_utils, PingResult};
use crate::*;
use std::{fs::File, io, io::prelude::*, path::PathBuf};
use tracing;

Expand Down
@@ -1,5 +1,4 @@
use crate::ping_result_processors::ping_result_processor::PingResultProcessor;
use crate::PingResult;
use crate::*;
use contracts::requires;
use std::time::Duration;
use tracing;
Expand Down
@@ -1,5 +1,4 @@
use crate::ping_result_processors::ping_result_processor::PingResultProcessor;
use crate::PingResult;
use crate::*;
use std::collections::BTreeMap;
use tracing;

Expand Down
@@ -1,6 +1,4 @@
use crate::ping_clients::ping_client::{PingClientError, PingClientWarning};
use crate::ping_result_processors::ping_result_processor::PingResultProcessor;
use crate::PingResult;
use crate::*;
use std::collections::BTreeMap;
use tracing;

Expand Down Expand Up @@ -46,7 +44,9 @@ impl PingResultProcessorResultScatterLogger {
}

impl PingResultProcessor for PingResultProcessorResultScatterLogger {
fn name(&self) -> &'static str { "ResultScatterLogger" }
fn name(&self) -> &'static str {
"ResultScatterLogger"
}

fn process_ping_result(&mut self, ping_result: &PingResult) {
// Skip warmup pings in analysis.
Expand Down Expand Up @@ -108,8 +108,9 @@ impl PingResultProcessor for PingResultProcessorResultScatterLogger {
for (port_bucket, result_hits) in iteration {
print!("{:>5} | {:>5} | ", iteration_index, port_bucket);

let result =
PingResultProcessorResultScatterLogger::convert_result_hits_to_string(result_hits);
let result = PingResultProcessorResultScatterLogger::convert_result_hits_to_string(
result_hits,
);
println!("{}", result);
}
}
Expand Down
@@ -1,4 +1,4 @@
use crate::ping_result_processors::ping_result_processor::PingResultProcessor;
use crate::PingResultProcessor;
use crate::rnp_test_common;

pub fn run_ping_result_processor_with_test_samples(
Expand Down
@@ -1,5 +1,4 @@
use crate::ping_result_processors::ping_result_processor::PingResultProcessor;
use crate::{rnp_utils, PingResult};
use crate::*;
use std::fs::File;
use std::io::prelude::*;
use std::path::PathBuf;
Expand Down

0 comments on commit 1c4d3d5

Please sign in to comment.