diff options
author | 2020-03-05 02:08:53 +0100 | |
---|---|---|
committer | 2020-03-05 02:08:53 +0100 | |
commit | a6531c840b97b1d30af5153c01fda69d09f43a08 (patch) | |
tree | 3beff9659e8cad42e51098efb3bd1cf35b5405b6 /examples | |
parent | 85ee2fc65a955f6020113a20b585bf3432a794a6 (diff) | |
download | iced-a6531c840b97b1d30af5153c01fda69d09f43a08.tar.gz iced-a6531c840b97b1d30af5153c01fda69d09f43a08.tar.bz2 iced-a6531c840b97b1d30af5153c01fda69d09f43a08.zip |
Implement `Subscription::with`
Diffstat (limited to 'examples')
-rw-r--r-- | examples/panes/src/main.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/panes/src/main.rs b/examples/panes/src/main.rs index 50b21fc5..b34ce205 100644 --- a/examples/panes/src/main.rs +++ b/examples/panes/src/main.rs @@ -77,8 +77,6 @@ impl Application for Launcher { } } - dbg!(self); - Command::none() } @@ -88,11 +86,14 @@ impl Application for Launcher { match example { Example::Clock(clock) => clock .subscription() - .map(move |message| Message::Clock(pane, message)), + .with(pane) + .map(|(pane, message)| Message::Clock(pane, message)), - Example::Stopwatch(stopwatch) => stopwatch - .subscription() - .map(move |message| Message::Stopwatch(pane, message)), + Example::Stopwatch(stopwatch) => { + stopwatch.subscription().with(pane).map( + |(pane, message)| Message::Stopwatch(pane, message), + ) + } } })); |