You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,7 @@ fn main() {
186
186
However, Rust's borrowing rules don’t allow more than one mutable reference at a time, which can be limiting in certain scenarios. For example, what if you need multiple parts of your program to mutate the same data simultaneously, without violating Rust’s safety? This is where the combination of `Rc<T>` and `RefCell<T>` comes into play, allowing shared ownership *and* mutation.
187
187
188
188
189
-
### Combining <RefCell> and <Rc> we can have multiple owners of mutable data. (single-threaded)
189
+
### Combining RefCell and Rc we can have multiple owners of mutable data. (single-threaded)
190
190
191
191
192
192
A common way to use `RefCell<T>` is in combination with `Rc<T>`. Recall that `Rc<T>` lets you have multiple owners of some data, but it only gives immutable access to that data by default. If you have an `Rc<T>` that holds a `RefCell<T>`, you can get a value that can have multiple owners *and* that you can mutate! [3]
0 commit comments