diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-11-10 19:14:50 -0500 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-11-10 19:15:02 -0500 |
| commit | 0f76cc3d9078b18e509dc88899daf23102019335 (patch) | |
| tree | 57996b434f191d83ed6637570fef7134205e9164 /dungeon/src/map.rs | |
| parent | Checkpoint writeup started (diff) | |
| download | DungeonCrawl-0f76cc3d9078b18e509dc88899daf23102019335.tar.gz DungeonCrawl-0f76cc3d9078b18e509dc88899daf23102019335.tar.bz2 DungeonCrawl-0f76cc3d9078b18e509dc88899daf23102019335.zip | |
minimize dependencies & features
Diffstat (limited to 'dungeon/src/map.rs')
| -rw-r--r-- | dungeon/src/map.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dungeon/src/map.rs b/dungeon/src/map.rs index fef0750..19c1de8 100644 --- a/dungeon/src/map.rs +++ b/dungeon/src/map.rs @@ -1,7 +1,7 @@ //! The `map` module contains structures of the dungeon game map //! including the current `Floor`, and map `Tile`. -use rand::{Rng, SeedableRng, rngs::StdRng}; +use rand::{rngs::StdRng, Rng, SeedableRng, TryRngCore}; use strum::IntoEnumIterator; use strum_macros::EnumIter; @@ -116,7 +116,8 @@ impl Floor { /// ``` #[must_use] pub fn generate() -> Self { - let seed = rand::random(); + let mut rng = rand::rngs::OsRng; + let seed = rng.try_next_u64().unwrap_or(0); Self::generate_seeded(seed) } |