Lesson 47 of 50
rustInterior Mutability with RefCell
12 minutes
Course progress94%
Interior Mutability with RefCell
RefCell<T> enforces borrowing rules at runtime, allowing mutable borrows even when the RefCell is immutable.
use std::cell::RefCell;
fn main() {
let data = RefCell::new(vec![, , ]);
data.().();
(\