From 977cf381ce5058793175e64fe1a92fb7812631ed Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sun, 17 Nov 2019 13:18:42 +0800 Subject: Add bound check --- crates/ra_cli/src/analysis_stats.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates') diff --git a/crates/ra_cli/src/analysis_stats.rs b/crates/ra_cli/src/analysis_stats.rs index 04aba3743..3429a3c49 100644 --- a/crates/ra_cli/src/analysis_stats.rs +++ b/crates/ra_cli/src/analysis_stats.rs @@ -169,12 +169,12 @@ pub fn run( println!( "Expressions of unknown type: {} ({}%)", num_exprs_unknown, - (num_exprs_unknown * 100 / num_exprs) + if num_exprs > 0 { (num_exprs_unknown * 100 / num_exprs) } else { 100 } ); println!( "Expressions of partially unknown type: {} ({}%)", num_exprs_partially_unknown, - (num_exprs_partially_unknown * 100 / num_exprs) + if num_exprs > 0 { (num_exprs_partially_unknown * 100 / num_exprs) } else { 100 } ); println!("Type mismatches: {}", num_type_mismatches); println!("Inference: {:?}, {}", inference_time.elapsed(), ra_prof::memory_usage()); -- cgit v1.2.3