Use expect instead of unwrap to make clippy happy
This commit is contained in:
parent
d4050c275e
commit
353945a01b
1 changed files with 1 additions and 1 deletions
|
@ -60,7 +60,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ArrayIndexing {
|
|||
// Array with known size can be checked statically
|
||||
let ty = cx.tables.expr_ty(array);
|
||||
if let ty::TyArray(_, size) = ty.sty {
|
||||
let size = ConstInt::Usize(ConstUsize::new(size as u64, cx.sess().target.uint_type).unwrap());
|
||||
let size = ConstInt::Usize(ConstUsize::new(size as u64, cx.sess().target.uint_type).expect("array size is invalid"));
|
||||
let constcx = ConstContext::with_tables(cx.tcx, cx.tables);
|
||||
|
||||
// Index is a constant uint
|
||||
|
|
Loading…
Add table
Reference in a new issue