cli_helpers: use anyhow in app fn; aquatic_ws: reorganize error handling

This commit is contained in:
Joakim Frostegård 2020-05-23 14:05:50 +02:00
parent 1efe6f96c5
commit 526faa9aab
13 changed files with 134 additions and 93 deletions

View file

@ -15,6 +15,7 @@ name = "aquatic_udp_bench_handlers"
name = "plot_pareto"
[dependencies]
anyhow = "1"
aquatic_udp = { path = "../aquatic_udp" }
bittorrent_udp = { path = "../bittorrent_udp" }
cli_helpers = { path = "../cli_helpers" }

View file

@ -45,7 +45,7 @@ fn main(){
}
pub fn run(bench_config: BenchConfig){
pub fn run(bench_config: BenchConfig) -> ::anyhow::Result<()> {
// Setup common state, spawn request handlers
let state = State::new();
@ -111,6 +111,8 @@ pub fn run(bench_config: BenchConfig){
print_results("Connect: ", c.0, c.1);
print_results("Announce:", a.0, a.1);
print_results("Scrape: ", s.0, s.1);
Ok(())
}