summaryrefslogtreecommitdiffstats
path: root/examples/pokedex
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-11-29 22:28:31 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-11-29 22:28:31 +0100
commite09b4e24dda51b8212d8ece52431dacaa3922a7b (patch)
tree7005e181528134ebdde5bbbe5909273db9f30174 /examples/pokedex
parent83c7870c569a2976923ee6243a19813094d44673 (diff)
parent7f8b17604a31e00becc43130ec516c1a53552c88 (diff)
downloadiced-e09b4e24dda51b8212d8ece52431dacaa3922a7b.tar.gz
iced-e09b4e24dda51b8212d8ece52431dacaa3922a7b.tar.bz2
iced-e09b4e24dda51b8212d8ece52431dacaa3922a7b.zip
Merge branch 'master' into feat/multi-window-support
Diffstat (limited to 'examples/pokedex')
-rw-r--r--examples/pokedex/Cargo.toml11
-rw-r--r--examples/pokedex/README.md4
-rw-r--r--examples/pokedex/src/main.rs4
3 files changed, 11 insertions, 8 deletions
diff --git a/examples/pokedex/Cargo.toml b/examples/pokedex/Cargo.toml
index e99fc0c3..bf7e1e35 100644
--- a/examples/pokedex/Cargo.toml
+++ b/examples/pokedex/Cargo.toml
@@ -6,7 +6,9 @@ edition = "2021"
publish = false
[dependencies]
-iced = { path = "../..", features = ["image", "debug", "tokio"] }
+iced.workspace = true
+iced.features = ["image", "debug", "tokio"]
+
serde_json = "1.0"
[dependencies.serde]
@@ -19,5 +21,8 @@ default-features = false
features = ["json", "rustls-tls"]
[dependencies.rand]
-version = "0.7"
-features = ["wasm-bindgen"]
+version = "0.8"
+
+[dependencies.getrandom]
+version = "0.2"
+features = ["js"]
diff --git a/examples/pokedex/README.md b/examples/pokedex/README.md
index 50720f57..8e8562ac 100644
--- a/examples/pokedex/README.md
+++ b/examples/pokedex/README.md
@@ -4,9 +4,7 @@ An application that loads a random Pokédex entry using the [PokéAPI].
All the example code can be found in the __[`main`](src/main.rs)__ file.
<div align="center">
- <a href="https://gfycat.com/aggressivedarkelephantseal-rust-gui">
- <img src="https://thumbs.gfycat.com/AggressiveDarkElephantseal-small.gif" height="400px">
- </a>
+ <img src="https://iced.rs/examples/pokedex.gif">
</div>
You can run it on native platforms with `cargo run`:
diff --git a/examples/pokedex/src/main.rs b/examples/pokedex/src/main.rs
index 1873b674..8b71a269 100644
--- a/examples/pokedex/src/main.rs
+++ b/examples/pokedex/src/main.rs
@@ -151,9 +151,9 @@ impl Pokemon {
}
let id = {
- let mut rng = rand::rngs::OsRng::default();
+ let mut rng = rand::rngs::OsRng;
- rng.gen_range(0, Pokemon::TOTAL)
+ rng.gen_range(0..Pokemon::TOTAL)
};
let fetch_entry = async {