This repository was archived by the owner on Aug 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ wasm-game-of-life
2525
2626## What's Inside
2727
28- Enter the new ` wasm-game-of-life ` project
28+ Enter the new ` wasm-game-of-life ` project
2929
3030```
3131cd wasm-game-of-life
@@ -61,23 +61,15 @@ WebAssembly. It uses `wasm-bindgen` to interface with JavaScript. It imports the
6161alerts a greeting message.
6262
6363``` rust
64- extern crate cfg_if;
65- extern crate wasm_bindgen;
66-
6764mod utils ;
6865
69- use cfg_if :: cfg_if;
7066use wasm_bindgen :: prelude :: * ;
7167
72- cfg_if! {
73- // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
74- // allocator.
75- if #[cfg(feature = " wee_alloc" )] {
76- extern crate wee_alloc;
77- #[global_allocator]
78- static ALLOC : wee_alloc :: WeeAlloc = wee_alloc :: WeeAlloc :: INIT ;
79- }
80- }
68+ // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
69+ // allocator.
70+ #[cfg(feature = " wee_alloc" )]
71+ #[global_allocator]
72+ static ALLOC : wee_alloc :: WeeAlloc = wee_alloc :: WeeAlloc :: INIT ;
8173
8274#[wasm_bindgen]
8375extern {
@@ -88,7 +80,6 @@ extern {
8880pub fn greet () {
8981 alert (" Hello, wasm-game-of-life!" );
9082}
91-
9283```
9384
9485### ` wasm-game-of-life/src/utils.rs `
You can’t perform that action at this time.
0 commit comments