File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ use rustc_span::{sym, Symbol};
99
1010declare_clippy_lint ! {
1111 /// ### What it does
12- /// Checks for `Arc::new` in `vec![elem; len]`
12+ /// Checks for `Arc::new` or `Rc::new` in `vec![elem; len]`
1313 ///
1414 /// ### Why is this bad?
1515 /// This will create `elem` once and clone it `len` times - doing so with `Arc`
@@ -19,10 +19,14 @@ declare_clippy_lint! {
1919 /// ### Example
2020 /// ```rust
2121 /// let v = vec![std::sync::Arc::new("some data".to_string()); 100];
22+ /// // or
23+ /// let v = vec![std::rc::Rc::new("some data".to_string())];
2224 /// ```
2325 /// Use instead:
2426 /// ```rust
2527 /// let data = std::sync::Arc::new("some data".to_string());
28+ /// // or
29+ /// let data = std::rc::Rc::new("some data".to_string());
2630 /// let v = vec![data; 100];
2731 /// ```
2832 #[ clippy:: version = "1.62.0" ]
You can’t perform that action at this time.
0 commit comments