more formatting & use statement fixups

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller
2019-08-22 13:46:31 +02:00
parent 89ceb33f89
commit 7a57cb77e1
4 changed files with 36 additions and 40 deletions

View File

@ -1,5 +1,6 @@
use std::thread;
use std::sync::{Arc, Mutex};
use std::thread;
use failure::*;
use tokio::prelude::*;
@ -9,13 +10,14 @@ pub struct StorageOperation {
}
impl StorageOperation {
pub fn new() -> Self {
StorageOperation { state: Arc::new(Mutex::new(false)), running: false }
StorageOperation {
state: Arc::new(Mutex::new(false)),
running: false,
}
}
fn run(&mut self, task: task::Task) {
let state = self.state.clone();
thread::spawn(move || {
@ -51,11 +53,8 @@ impl Future for StorageOperation {
}
}
#[test]
fn test_storage_future()
{
fn test_storage_future() {
let op = StorageOperation::new();
hyper::rt::run(op.map_err(|e| {
println!("Got Error: {}", e);