File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -216,18 +216,19 @@ declare_clippy_lint! {
216
216
}
217
217
218
218
declare_clippy_lint ! {
219
- /// **What it does:** Checks for Rc<T> and Arc<T> when T is a mutable buffer type such as String or Vec
219
+ /// **What it does:** Checks for ` Rc<T>` and ` Arc<T>` when `T` is a mutable buffer type such as ` String` or ` Vec`.
220
220
///
221
- /// **Why is this bad?** Expressions such as Rc<String> have no advantage over Rc<str>, since
222
- /// it is larger and involves an extra level of indirection, and doesn't implement Borrow<str>.
221
+ /// **Why is this bad?** Expressions such as ` Rc<String>` usually have no advantage over ` Rc<str>` , since
222
+ /// it is larger and involves an extra level of indirection, and doesn't implement ` Borrow<str>` .
223
223
///
224
- /// While mutating a buffer type would still be possible with Rc::get_mut(), it only
225
- /// works if there are no additional references yet, which defeats the purpose of
224
+ /// While mutating a buffer type would still be possible with ` Rc::get_mut()` , it only
225
+ /// works if there are no additional references yet, which usually defeats the purpose of
226
226
/// enclosing it in a shared ownership type. Instead, additionally wrapping the inner
227
- /// type with an interior mutable container (such as RefCell or Mutex) would normally
227
+ /// type with an interior mutable container (such as ` RefCell` or ` Mutex` ) would normally
228
228
/// be used.
229
229
///
230
- /// **Known problems:** None.
230
+ /// **Known problems:** This pattern can be desirable to avoid the overhead of a `RefCell` or `Mutex` for
231
+ /// cases where mutation only happens before there are any additional references.
231
232
///
232
233
/// **Example:**
233
234
/// ```rust,ignore
You can’t perform that action at this time.
0 commit comments