Skip to content

Commit

Permalink
Fix vecs!
Browse files Browse the repository at this point in the history
  • Loading branch information
AslD committed Jul 29, 2024
1 parent 02b4926 commit 0e9e1c3
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 27 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
site/docs/tutorials/snake/setting-color-palette.md
9 changes: 1 addition & 8 deletions cli/assets/templates/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@ edition = "2021"
[lib]
crate-type = ["cdylib"]

[dependencies]
buddy-alloc = { version = "0.4.1", optional = true }

[profile.release]
opt-level = "z"
lto = true
strip = true
panic = "abort"
codegen-units = 1

[features]
# use `--no-default-features` or comment out next line to disable allocator
default = ["buddy-alloc"]
codegen-units = 1
16 changes: 0 additions & 16 deletions cli/assets/templates/rust/src/alloc.rs

This file was deleted.

5 changes: 3 additions & 2 deletions cli/assets/templates/rust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![no_std]
#[cfg(feature = "buddy-alloc")]
mod alloc;

#[cfg(not(std))]
extern crate alloc;
mod wasm4;
use wasm4::*;

Expand Down
3 changes: 3 additions & 0 deletions site/docs/tutorials/snake/creating-the-snake.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ You can learn more about these traits in the [rust-book](https://doc.rust-lang.o
- [Clone, Copy](https://doc.rust-lang.org/book/appendix-03-derivable-traits.html?highlight=partialEq#clone-and-copy-for-duplicating-values)

```rust
use alloc::vec::{self, Vec};
use crate::wasm4;

#[derive(Clone, Copy, PartialEq, Eq)]
pub struct Point {
pub x: i32,
Expand Down
2 changes: 1 addition & 1 deletion site/docs/tutorials/snake/setting-color-palette.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ end
```

```rust
#![no_std]
#[cfg(feature = "buddy-alloc")]
mod alloc;
mod wasm4;

#[no_mangle]
Expand Down

0 comments on commit 0e9e1c3

Please sign in to comment.