Cargo fmt

This commit is contained in:
Arne Beer 2018-12-23 19:41:42 +01:00
parent 1efadc4fb2
commit 550ae6996a
4 changed files with 11 additions and 23 deletions

View file

@ -25,7 +25,6 @@ pub struct AddMessage {
pub path: String,
}
#[derive(Serialize, Deserialize)]
pub struct RemoveMessage {
pub command: String,
@ -45,25 +44,25 @@ pub struct StartMessage {
}
#[derive(Serialize, Deserialize)]
pub struct PauseMessage{
pub struct PauseMessage {
pub command: String,
pub path: String,
}
#[derive(Serialize, Deserialize)]
pub struct KillMessage{
pub struct KillMessage {
pub command: String,
pub path: String,
}
#[derive(Serialize, Deserialize)]
pub struct SuccessMessage{
pub struct SuccessMessage {
pub command: String,
pub path: String,
}
#[derive(Serialize, Deserialize)]
pub struct FailureMessage{
pub struct FailureMessage {
pub command: String,
pub path: String,
}

View file

@ -48,14 +48,11 @@ impl Daemon {
add_task(&mut self.queue, message);
}
Message::Remove(message) => {
}
Message::Remove(message) => {}
Message::Start(message) => {
}
Message::Start(message) => {}
Message::Pause(message) => {
}
Message::Pause(message) => {}
Message::Failure => panic!("Invalid message type"),

View file

@ -1,5 +1,4 @@
use ::std::mem;
use ::std::process::ExitStatus;
use ::tokio_process::Child;
use crate::communication::message::*;
@ -52,9 +51,4 @@ pub fn change_status(queue: &mut Queue, index: usize, status: TaskStatus) {
task.status = status;
}
pub fn handle_finished_child(
_queue: &mut Queue,
_index: usize,
_child: Box<Child>,
) {
}
pub fn handle_finished_child(_queue: &mut Queue, _index: usize, _child: Box<Child>) {}

View file

@ -1,9 +1,9 @@
use ::failure::Error;
use ::std::collections::HashMap;
use ::std::process::{Command, Stdio, ExitStatus};
use ::tokio_process::{CommandExt, Child};
use ::futures::prelude::*;
use ::futures::Future;
use ::std::collections::HashMap;
use ::std::process::{Command, ExitStatus, Stdio};
use ::tokio_process::{Child, CommandExt};
use crate::daemon::queue::*;
use crate::daemon::task::{Task, TaskStatus};
@ -61,7 +61,6 @@ impl TaskHandler {
}
// Child process is not done, keep waiting
Async::NotReady => continue,
}
}
}
@ -69,7 +68,6 @@ impl TaskHandler {
(finished, errored)
}
/// See if the task manager has a free slot and can start a new process.
fn check_new(&mut self, queue: &mut Queue) -> Result<(), Error> {
let next_task = get_next_task(queue);