-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Change Rc<Box<T>> recommendation to be Rc<T> instead of Box<T> #5899
Conversation
r? @yaahc (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, ty for the PR.
cc @flip1995
clippy_lints/src/types.rs
Outdated
_ => panic!("Box that isn't a type"), | ||
}, | ||
_ => panic!("Rc without type argument"), | ||
}; | ||
let inner_span = match &last_path_segment(&box_ty).args.unwrap().args[0] { | ||
GenericArg::Type(ty) => ty.span, | ||
_ => panic!("Box without type argument"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's probably fine, I don't think any of these branches can get hit, but I think it might be better to early return rather than panicking.
@bors r+ |
📌 Commit 4e28d99 has been approved by |
Change Rc<Box<T>> recommendation to be Rc<T> instead of Box<T> Changelog: Fixes #5722
💔 Test failed - checks-action_test |
@bors retry |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Fixes #5722
changelog: Suggest
Rc<Box<T>>
->Rc<T>
in [redundant_allocation
] lint