From cd708c3ef3f8c070f4b0c566575fb043c4eb1e8e Mon Sep 17 00:00:00 2001 From: Till Hoeppner Date: Sun, 4 Jan 2015 23:34:37 +0100 Subject: I should make smaller commits. --- src/callback.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/callback.rs') diff --git a/src/callback.rs b/src/callback.rs index c62ebf8..b2027f6 100644 --- a/src/callback.rs +++ b/src/callback.rs @@ -1,15 +1,15 @@ -pub struct Callback { - items: Vec +pub struct Callback { + items: Vec } -impl Callback { +impl Callback { pub fn new() -> Callback { Callback { items: Vec::new() } } - pub fn register(&mut self, f: &fn(A)) { - self.items.push(*f) + pub fn register(&mut self, f: fn(&mut A)) { + self.items.push(f) } - pub fn fire(&self, v: &A) { - for _ in self.items.iter().map(|&c| c(v.clone())) {} + pub fn fire(&self, v: &mut A) { + for _ in self.items.iter().map(|&c| c(v)) {} } } -- cgit v1.2.3