diff --git a/examples/stress_tests/bevymark.rs b/examples/stress_tests/bevymark.rs index 02278e6610ad9..9a3ef143bed66 100644 --- a/examples/stress_tests/bevymark.rs +++ b/examples/stress_tests/bevymark.rs @@ -94,7 +94,11 @@ impl FromStr for Mode { const FIXED_TIMESTEP: f32 = 0.2; fn main() { + // `from_env` panics on the web + #[cfg(not(target_arch = "wasm32"))] let args: Args = argh::from_env(); + #[cfg(target_arch = "wasm32")] + let args = Args::from_args(&[], &[]).unwrap(); App::new() .add_plugins(( diff --git a/examples/stress_tests/many_buttons.rs b/examples/stress_tests/many_buttons.rs index 64b69902ae649..405f0c46a55ac 100644 --- a/examples/stress_tests/many_buttons.rs +++ b/examples/stress_tests/many_buttons.rs @@ -42,7 +42,12 @@ struct Args { /// This example shows what happens when there is a lot of buttons on screen. fn main() { + // `from_env` panics on the web + #[cfg(not(target_arch = "wasm32"))] let args: Args = argh::from_env(); + #[cfg(target_arch = "wasm32")] + let args = Args::from_args(&[], &[]).unwrap(); + let mut app = App::new(); app.add_plugins(( diff --git a/examples/stress_tests/many_cubes.rs b/examples/stress_tests/many_cubes.rs index 1da8e18bbe1ec..ebbee17032176 100644 --- a/examples/stress_tests/many_cubes.rs +++ b/examples/stress_tests/many_cubes.rs @@ -66,7 +66,11 @@ impl FromStr for Layout { } fn main() { + // `from_env` panics on the web + #[cfg(not(target_arch = "wasm32"))] let args: Args = argh::from_env(); + #[cfg(target_arch = "wasm32")] + let args = Args::from_args(&[], &[]).unwrap(); App::new() .add_plugins(( diff --git a/examples/stress_tests/many_foxes.rs b/examples/stress_tests/many_foxes.rs index 8cdb350146aa8..8311b494e4090 100644 --- a/examples/stress_tests/many_foxes.rs +++ b/examples/stress_tests/many_foxes.rs @@ -33,7 +33,11 @@ struct Foxes { } fn main() { + // `from_env` panics on the web + #[cfg(not(target_arch = "wasm32"))] let args: Args = argh::from_env(); + #[cfg(target_arch = "wasm32")] + let args = Args::from_args(&[], &[]).unwrap(); App::new() .add_plugins(( diff --git a/examples/ui/text_wrap_debug.rs b/examples/ui/text_wrap_debug.rs index 0bd928ebd3ffb..657ba0dc76006 100644 --- a/examples/ui/text_wrap_debug.rs +++ b/examples/ui/text_wrap_debug.rs @@ -19,7 +19,12 @@ struct Args { } fn main() { + // `from_env` panics on the web + #[cfg(not(target_arch = "wasm32"))] let args: Args = argh::from_env(); + #[cfg(target_arch = "wasm32")] + let args = Args::from_args(&[], &[]).unwrap(); + let window = if let Some(scale_factor) = args.scale_factor { Window { resolution: WindowResolution::default().with_scale_factor_override(scale_factor),