Skip to content

Commit

Permalink
Merge pull request #10 from ihrwein/refactors
Browse files Browse the repository at this point in the history
Lot of small refactors in one huge PR
  • Loading branch information
ihrwein committed Feb 4, 2016
2 parents fa66aea + eba7caa commit 7f3b6f2
Show file tree
Hide file tree
Showing 41 changed files with 723 additions and 813 deletions.
10 changes: 10 additions & 0 deletions src/action.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use state::State;
use dispatcher::response::ResponseSender;
use context::base::BaseContext;

pub use config::action::message::Alert;

pub trait Action {
fn on_opened(&self, state: &State, context: &BaseContext, &mut ResponseSender);
fn on_closed(&self, state: &State, context: &BaseContext, &mut ResponseSender);
}
151 changes: 0 additions & 151 deletions src/action/message/mod.rs

This file was deleted.

127 changes: 0 additions & 127 deletions src/action/message/test.rs

This file was deleted.

20 changes: 0 additions & 20 deletions src/action/mod.rs

This file was deleted.

10 changes: 5 additions & 5 deletions src/bin/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ extern crate maplit;
extern crate correlation;
extern crate uuid;

use correlation::{config, Correlator};
use correlation::Correlator;
use correlation::config::ContextConfigBuilder;
use correlation::conditions::ConditionsBuilder;
use correlation::message::MessageBuilder;
use uuid::Uuid;
Expand All @@ -25,11 +26,10 @@ fn main() {
.first_opens(true)
.last_closes(true)
.build();
let actions = vec![];
let contexts = vec![
config::ContextBuilder::new(Uuid::new_v4(), condition.clone()).actions(actions.clone()).build(),
config::ContextBuilder::new(Uuid::new_v4(), condition.clone()).actions(actions.clone()).build(),
config::ContextBuilder::new(Uuid::new_v4(), condition.clone()).actions(actions.clone()).build(),
ContextConfigBuilder::new(Uuid::new_v4(), condition.clone()).actions(Vec::new()).build(),
ContextConfigBuilder::new(Uuid::new_v4(), condition.clone()).actions(Vec::new()).build(),
ContextConfigBuilder::new(Uuid::new_v4(), condition.clone()).actions(Vec::new()).build(),
];
let mut correlator = Correlator::new(contexts);
let _ = correlator.push_message(MessageBuilder::new(&uuid1, "message").build());
Expand Down
23 changes: 0 additions & 23 deletions src/condition.rs

This file was deleted.

Loading

0 comments on commit 7f3b6f2

Please sign in to comment.