From 32e1bf42606bfdc01675c54c1cc7f1a7dff7eda5 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 23 May 2019 07:20:05 +0200 Subject: [PATCH] src/bin/upload-speed.rs: code cleanup --- src/bin/upload-speed.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/bin/upload-speed.rs b/src/bin/upload-speed.rs index 2724e805..1e0a37f0 100644 --- a/src/bin/upload-speed.rs +++ b/src/bin/upload-speed.rs @@ -1,6 +1,5 @@ use failure::*; use futures::*; -use serde_json::json; use proxmox_backup::client::*; @@ -11,14 +10,12 @@ fn upload_speed() -> Result { let username = "root@pam"; - let mut client = HttpClient::new(host, username)?; + let client = HttpClient::new(host, username)?; - let upgrade = client.start_backup(datastore, "host", "speedtest"); + let client = client.start_backup(datastore, "host", "speedtest").wait()?; - let res = upgrade.and_then(|h2| { - println!("start upload speed test"); - h2.upload_speedtest() - }).wait()?; + println!("start upload speed test"); + let res = client.upload_speedtest().wait()?; Ok(res) }