Skip to content

Commit

Permalink
Add impl for std traits
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspustina committed Jan 11, 2020
1 parent 2dc83f7 commit d980e10
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use subprocess::{Popen, PopenConfig, Redirection};
/// } => println!("Command errored because {}", reason),
/// };
/// ```
#[derive(Debug, Deserialize, PartialEq, Serialize, Clone)]
#[derive(Debug, Deserialize, PartialEq, Eq, Serialize, Clone)]
pub struct Command {
pub(crate) name: String,
pub(crate) title: Option<String>,
Expand Down Expand Up @@ -177,7 +177,7 @@ impl Command {
}
}

#[derive(Debug, Deserialize, PartialEq, Serialize, Clone)]
#[derive(Debug, PartialEq, Eq, Deserialize, Serialize, Clone)]
pub struct Link {
pub(crate) name: String,
pub(crate) url: String,
Expand All @@ -197,7 +197,7 @@ impl Link {
}

/// Encapsulates a command execution result
#[derive(Debug, PartialEq, Serialize)]
#[derive(Debug, PartialEq, Eq, Deserialize, Serialize, Clone)]
pub enum CommandResult {
/// `Command` has been executed successfully and `String` contains stdout.
Success {
Expand Down
8 changes: 4 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub enum Error {
/// Result type
pub type Result<T, E = Error> = std::result::Result<T, E>;

#[derive(Debug, Deserialize, Serialize, PartialEq)]
#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone)]
pub struct Config {
pub defaults: Defaults,
pub hostinfo: Option<Hostinfo>,
Expand Down Expand Up @@ -166,7 +166,7 @@ impl Config {
}
}

#[derive(Debug, Deserialize, Serialize, PartialEq)]
#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone)]
pub struct Defaults {
#[serde(default = "default_profile")]
pub profile: String,
Expand Down Expand Up @@ -197,12 +197,12 @@ fn default_repetitions() -> usize { Defaults::default().repetitions }

fn default_max_parallel_commands() -> usize { Defaults::default().max_parallel_commands }

#[derive(Debug, Deserialize, Serialize, PartialEq)]
#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone)]
pub struct Hostinfo {
pub commands: Vec<String>,
}

#[derive(Debug, Deserialize, Serialize, PartialEq)]
#[derive(Debug, Deserialize, Serialize, PartialEq, Eq, Clone)]
pub struct Profile {
pub name: String,
pub commands: Vec<String>,
Expand Down
3 changes: 2 additions & 1 deletion src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub use json::JsonRenderer;
pub mod json {
use super::*;

#[derive(Default)]
#[derive(Default, Debug, Eq, PartialEq, Clone)]
pub struct JsonRenderer {}

impl JsonRenderer {
Expand All @@ -53,6 +53,7 @@ pub mod handlebars {
use ::handlebars::Handlebars;
use std::{fs::File, io::Read, path::Path};

#[derive(Default, Debug, Eq, PartialEq, Clone)]
pub struct HbsRenderer {
template: String,
}
Expand Down
5 changes: 1 addition & 4 deletions src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub mod thread {
thread::JoinHandle,
};

#[derive(Default, Debug, Clone)]
pub struct ThreadRunner {
progress_tx: Option<Sender<usize>>,
}
Expand Down Expand Up @@ -121,10 +122,6 @@ pub mod thread {
}
}

impl Default for ThreadRunner {
fn default() -> Self { ThreadRunner { progress_tx: None } }
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit d980e10

Please sign in to comment.