-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Lint for vec![Rc::new(..); N]
#3377
Comments
Could you please give a little more information here? What should the Lint warn about or suggest? Maybe a code example would also be helpful. |
The use std::{rc::Rc, cell::Cell};
let v = vec![Rc::new(Cell::new(false)); 3];
v[1].set(true);
println!("{:?}", v); // [true, true, true] |
I'm not sure about the best alternative, (0..N).map(|_| Rc::new(..)).collect() ¯\_(ツ)_/¯ |
This lint exists today. Output for the code above:
|
A guy on discord got pretty confused by this.
The text was updated successfully, but these errors were encountered: