• Ephera@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 hours ago

    To be honest, I wish sometimes Rust had an optional GC mode (I know this would be against the principles of the language… don’t take this wish too seriously).

    If you just need the occasional cop-out, you can wrap a value in an Rc or an Arc. They do reference-counting, which is almost like garbage collection (reference counting can’t resolve cycles between references).