//! The seeded random tree `tests/generated.rs` checks, drawn so it can be //! looked at. `IRIS_SEED` and `IRIS_DEPTH` choose which one. use iris::prelude::*; use iris::random::Edits; fn env(name: &str, fallback: u64) -> u64 { std::env::var(name) .ok() .and_then(|v| v.parse().ok()) .unwrap_or(fallback) } fn main() { DefaultApp::::run(); } #[derive(DefaultUiState)] struct State { ui_state: DefaultUiState, } impl DefaultAppState for State { fn new(mut ui_state: DefaultUiState, rsc: &mut DefaultRsc, _: Proxy) -> Self { let seed = env("IRIS_SEED", 1); let depth = env("IRIS_DEPTH", 4) as usize; let (root, _) = iris::random::grow(rsc, seed, depth, &Edits::default()); ui_state.set_root(root); Self { ui_state } } }