What is Nostr?
jex
npub1ru9…35qe
2024-03-15 13:59:43

jex on Nostr: simple example showcasing stack vs heap behavior let w = 5; let x = w; // two copies ...

simple example showcasing stack vs heap behavior

let w = 5;
let x = w; // two copies of value w now on the stack
let y = Box::new(w); // copy value w on the heap (y points to it from stack)
let z = y // ownership change. y goes out of scope and now z points to that value on the heap.
Author Public Key
npub1ru9hzql8n8nqkakcfxljd9kjtqsywfse6kcy2w78s89n77qqs3msgl35qe