Actually fix the lint applied
This commit is contained in:
parent
a4c4da1c4b
commit
80cb48ca1a
1 changed files with 2 additions and 2 deletions
|
@ -142,7 +142,7 @@ fn check_ty(cx: &LateContext, ast_ty: &hir::Ty) {
|
||||||
match_def_path(cx.tcx, did, &paths::VEC),
|
match_def_path(cx.tcx, did, &paths::VEC),
|
||||||
], {
|
], {
|
||||||
span_help_and_lint(cx,
|
span_help_and_lint(cx,
|
||||||
BORROWED_BOX,
|
BOX_VEC,
|
||||||
ast_ty.span,
|
ast_ty.span,
|
||||||
"you seem to be trying to use `Box<Vec<T>>`. Consider using just `Vec<T>`",
|
"you seem to be trying to use `Box<Vec<T>>`. Consider using just `Vec<T>`",
|
||||||
"`Vec<T>` is already on the heap, `Box<Vec<T>>` makes an extra allocation.");
|
"`Vec<T>` is already on the heap, `Box<Vec<T>>` makes an extra allocation.");
|
||||||
|
@ -184,7 +184,7 @@ fn check_ty(cx: &LateContext, ast_ty: &hir::Ty) {
|
||||||
if let Some(def_id) = opt_def_id(def) {
|
if let Some(def_id) = opt_def_id(def) {
|
||||||
if Some(def_id) == cx.tcx.lang_items.owned_box() {
|
if Some(def_id) == cx.tcx.lang_items.owned_box() {
|
||||||
span_help_and_lint(cx,
|
span_help_and_lint(cx,
|
||||||
BOX_VEC,
|
BORROWED_BOX,
|
||||||
ast_ty.span,
|
ast_ty.span,
|
||||||
"you seem to be trying to use `&Box<T>`. Consider using just `&T`",
|
"you seem to be trying to use `&Box<T>`. Consider using just `&T`",
|
||||||
"replace `&Box<T>` with simply `&T`");
|
"replace `&Box<T>` with simply `&T`");
|
||||||
|
|
Loading…
Add table
Reference in a new issue