This commit is contained in:
nora 2023-01-15 12:13:06 +01:00
parent 2560ba4253
commit 5fcdcc0f48
8 changed files with 216 additions and 1 deletions

14
examples/scratch.rs Normal file
View file

@ -0,0 +1,14 @@
use uwu::scratch::{
actual_scratch_read, actual_scratch_write, define_scratch, scratch_space, Scratch,
};
#[scratch_space]
fn has_scratch_space(mut scratch: Scratch<'_>) {
scratch_write!(scratch, 10u32);
let _: u32 = scratch_read!(scratch);
}
fn main() {
define_scratch!(scratch, 10);
has_scratch_space(scratch);
}