diff options
| author | Yechan Bae <yechan@gatech.edu> | 2021-10-09 05:59:53 -0400 |
|---|---|---|
| committer | Yechan Bae <yechan@gatech.edu> | 2021-10-09 05:59:53 -0400 |
| commit | 03fed75c89880e5ed919eec1ba93dbe769d463a2 (patch) | |
| tree | 44ca810fc3effd1cfcb107833096ba6595b7dc55 | |
| parent | 2181387c3ab4d7dc4d6e2c46c8158201a1b1045e (diff) | |
| download | rust-03fed75c89880e5ed919eec1ba93dbe769d463a2.tar.gz rust-03fed75c89880e5ed919eec1ba93dbe769d463a2.zip | |
Address internal lints
| -rw-r--r-- | clippy_lints/src/uninit_vec.rs | 2 | ||||
| -rw-r--r-- | clippy_utils/src/higher.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/uninit_vec.rs b/clippy_lints/src/uninit_vec.rs index 15c79da6fa9..2573209d1b6 100644 --- a/clippy_lints/src/uninit_vec.rs +++ b/clippy_lints/src/uninit_vec.rs @@ -113,7 +113,7 @@ fn handle_uninit_vec_pair( UNINIT_VEC, vec![call_span, maybe_init_or_reserve.span], "calling `set_len()` on empty `Vec` creates out-of-bound values", - ) + ); } } } diff --git a/clippy_utils/src/higher.rs b/clippy_utils/src/higher.rs index 30f6831dcf4..1ff282de950 100644 --- a/clippy_utils/src/higher.rs +++ b/clippy_utils/src/higher.rs @@ -11,7 +11,7 @@ use rustc_hir::{ Arm, Block, BorrowKind, Expr, ExprKind, HirId, LoopSource, MatchSource, Node, Pat, QPath, StmtKind, UnOp, }; use rustc_lint::LateContext; -use rustc_span::{sym, ExpnKind, Span, Symbol}; +use rustc_span::{sym, symbol, ExpnKind, Span, Symbol}; /// The essential nodes of a desugared for loop as well as the entire span: /// `for pat in arg { body }` becomes `(pat, arg, body)`. Return `(pat, arg, body, span)`. @@ -658,7 +658,7 @@ pub fn get_vec_init_kind<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) - { if name.ident.name == sym::new { return Some(VecInitKind::New); - } else if name.ident.name.as_str() == "default" { + } else if name.ident.name == symbol::kw::Default { return Some(VecInitKind::Default); } else if name.ident.name.as_str() == "with_capacity" { let arg = args.get(0)?; |
