deactive profiler when not in use; use newtype structs for task chans

This commit is contained in:
Tim Kuehn 2013-09-19 21:29:23 -04:00
parent 17864cb25d
commit c804db0f93
7 changed files with 55 additions and 92 deletions

View file

@ -111,17 +111,9 @@ pub struct Reflow {
/// Encapsulates a channel to the layout task.
#[deriving(Clone)]
pub struct LayoutChan {
chan: SharedChan<Msg>,
}
pub struct LayoutChan(SharedChan<Msg>);
impl LayoutChan {
pub fn new(chan: Chan<Msg>) -> LayoutChan {
LayoutChan {
chan: SharedChan::new(chan),
}
}
pub fn send(&self, msg: Msg) {
self.chan.send(msg);
LayoutChan(SharedChan::new(chan))
}
}