2 Checks for `Rc<T>` and `Arc<T>` when `T` is a mutable buffer type such as `String` or `Vec`.
5 Expressions such as `Rc<String>` usually have no advantage over `Rc<str>`, since
6 it is larger and involves an extra level of indirection, and doesn't implement `Borrow<str>`.
8 While mutating a buffer type would still be possible with `Rc::get_mut()`, it only
9 works if there are no additional references yet, which usually defeats the purpose of
10 enclosing it in a shared ownership type. Instead, additionally wrapping the inner
11 type with an interior mutable container (such as `RefCell` or `Mutex`) would normally
15 This pattern can be desirable to avoid the overhead of a `RefCell` or `Mutex` for
16 cases where mutation only happens before there are any additional references.
20 fn foo(interned: Rc<String>) { ... }
26 fn foo(interned: Rc<str>) { ... }