1
Fork 0
This commit is contained in:
Yuki Okushi 2019-12-27 16:12:26 +09:00
parent b0c4744d57
commit e2636729ec
109 changed files with 735 additions and 655 deletions

View file

@ -29,7 +29,7 @@ declare_clippy_lint! {
declare_lint_pass!(UselessVec => [USELESS_VEC]);
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UselessVec {
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr<'_>) {
// search for `&vec![_]` expressions where the adjusted type is `&[_]`
if_chain! {
if let ty::Ref(_, ty, _) = cx.tables.expr_ty_adjusted(expr).kind;