From 03f72cff8e740be0d0db9695b500ac73e9a1b563 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Tue, 22 Jan 2019 19:11:46 -0500 Subject: [PATCH] RefCell is OK too. --- _drafts/understanding-allocations-in-rust.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_drafts/understanding-allocations-in-rust.md b/_drafts/understanding-allocations-in-rust.md index dc3e11a..5af6d3f 100644 --- a/_drafts/understanding-allocations-in-rust.md +++ b/_drafts/understanding-allocations-in-rust.md @@ -518,8 +518,9 @@ guidelines are in order: [`HashMap`](https://doc.rust-lang.org/stable/std/collections/struct.HashMap.html) - Enums and other wrapper types will not trigger heap allocations unless the underlying type also needs heap allocation. You can use - [`Option`](https://doc.rust-lang.org/stable/core/option/enum.Option.html) and - [`Result`](https://doc.rust-lang.org/stable/core/result/enum.Result.html) + [`Option`](https://doc.rust-lang.org/stable/core/option/enum.Option.html), + [`Result`](https://doc.rust-lang.org/stable/core/result/enum.Result.html), and + [`RefCell`](https://doc.rust-lang.org/stable/core/cell/struct.RefCell.html) with reckless abandon. - [Arrays](https://doc.rust-lang.org/std/primitive.array.html) are guaranteed to be stack-allocated in all circumstances.