Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 149dc13

Browse files
authored
Merge pull request #194 from d0iasm/master
Update the template source code
2 parents 7d50dc6 + 93b8801 commit 149dc13

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

src/game-of-life/hello-world.md

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff 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
```
3131
cd wasm-game-of-life
@@ -61,23 +61,15 @@ WebAssembly. It uses `wasm-bindgen` to interface with JavaScript. It imports the
6161
alerts a greeting message.
6262

6363
```rust
64-
extern crate cfg_if;
65-
extern crate wasm_bindgen;
66-
6764
mod utils;
6865

69-
use cfg_if::cfg_if;
7066
use 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]
8375
extern {
@@ -88,7 +80,6 @@ extern {
8880
pub fn greet() {
8981
alert("Hello, wasm-game-of-life!");
9082
}
91-
9283
```
9384

9485
### `wasm-game-of-life/src/utils.rs`

0 commit comments

Comments
 (0)