File tree 2 files changed +11
-10
lines changed
2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,19 @@ extern crate wasm_bindgen;
3
3
4
4
mod utils;
5
5
6
+ use cfg_if:: cfg_if;
6
7
use wasm_bindgen:: prelude:: * ;
7
8
9
+ cfg_if ! {
10
+ // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
11
+ // allocator.
12
+ if #[ cfg( feature = "wee_alloc" ) ] {
13
+ extern crate wee_alloc;
14
+ #[ global_allocator]
15
+ static ALLOC : wee_alloc:: WeeAlloc = wee_alloc:: WeeAlloc :: INIT ;
16
+ }
17
+ }
18
+
8
19
#[ wasm_bindgen]
9
20
extern {
10
21
fn alert ( s : & str ) ;
Original file line number Diff line number Diff line change @@ -11,13 +11,3 @@ cfg_if! {
11
11
pub fn set_panic_hook( ) { }
12
12
}
13
13
}
14
-
15
- cfg_if ! {
16
- // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
17
- // allocator.
18
- if #[ cfg( feature = "wee_alloc" ) ] {
19
- extern crate wee_alloc;
20
- #[ global_allocator]
21
- static ALLOC : wee_alloc:: WeeAlloc = wee_alloc:: WeeAlloc :: INIT ;
22
- }
23
- }
You can’t perform that action at this time.
0 commit comments