summaryrefslogtreecommitdiffstats
path: root/examples/stopwatch
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--examples/stopwatch/Cargo.toml12
-rw-r--r--examples/stopwatch/src/main.rs (renamed from examples/stopwatch.rs)5
2 files changed, 16 insertions, 1 deletions
diff --git a/examples/stopwatch/Cargo.toml b/examples/stopwatch/Cargo.toml
new file mode 100644
index 00000000..1dae3b83
--- /dev/null
+++ b/examples/stopwatch/Cargo.toml
@@ -0,0 +1,12 @@
+[package]
+name = "stopwatch"
+version = "0.1.0"
+authors = ["Héctor Ramón Jiménez <hector0193@gmail.com>"]
+edition = "2018"
+publish = false
+
+[dependencies]
+iced = { path = "../.." }
+iced_native = { path = "../../native" }
+iced_futures = { path = "../../futures", features = ["async-std"] }
+async-std = { version = "1.0", features = ["unstable"] }
diff --git a/examples/stopwatch.rs b/examples/stopwatch/src/main.rs
index c9a61ee9..d84c4817 100644
--- a/examples/stopwatch.rs
+++ b/examples/stopwatch/src/main.rs
@@ -28,6 +28,7 @@ enum Message {
}
impl Application for Stopwatch {
+ type Executor = iced_futures::executor::AsyncStd;
type Message = Message;
fn new() -> (Stopwatch, Command<Message>) {
@@ -142,6 +143,8 @@ impl Application for Stopwatch {
}
mod time {
+ use iced::futures;
+
pub fn every(
duration: std::time::Duration,
) -> iced::Subscription<std::time::Instant> {
@@ -165,7 +168,7 @@ mod time {
fn stream(
self: Box<Self>,
- _input: I,
+ _input: futures::stream::BoxStream<'static, I>,
) -> futures::stream::BoxStream<'static, Self::Output> {
use futures::stream::StreamExt;