diff options
author | Edwin Cheng <[email protected]> | 2019-11-17 05:18:42 +0000 |
---|---|---|
committer | Edwin Cheng <[email protected]> | 2019-11-17 05:18:42 +0000 |
commit | 977cf381ce5058793175e64fe1a92fb7812631ed (patch) | |
tree | 9c21d820a2341179e58dca7e1c0fd1723351fd92 /crates/ra_cli | |
parent | d0357fc3b270d5b05665395b95958ac2a3d1c51a (diff) |
Add bound check
Diffstat (limited to 'crates/ra_cli')
-rw-r--r-- | crates/ra_cli/src/analysis_stats.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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( | |||
169 | println!( | 169 | println!( |
170 | "Expressions of unknown type: {} ({}%)", | 170 | "Expressions of unknown type: {} ({}%)", |
171 | num_exprs_unknown, | 171 | num_exprs_unknown, |
172 | (num_exprs_unknown * 100 / num_exprs) | 172 | if num_exprs > 0 { (num_exprs_unknown * 100 / num_exprs) } else { 100 } |
173 | ); | 173 | ); |
174 | println!( | 174 | println!( |
175 | "Expressions of partially unknown type: {} ({}%)", | 175 | "Expressions of partially unknown type: {} ({}%)", |
176 | num_exprs_partially_unknown, | 176 | num_exprs_partially_unknown, |
177 | (num_exprs_partially_unknown * 100 / num_exprs) | 177 | if num_exprs > 0 { (num_exprs_partially_unknown * 100 / num_exprs) } else { 100 } |
178 | ); | 178 | ); |
179 | println!("Type mismatches: {}", num_type_mismatches); | 179 | println!("Type mismatches: {}", num_type_mismatches); |
180 | println!("Inference: {:?}, {}", inference_time.elapsed(), ra_prof::memory_usage()); | 180 | println!("Inference: {:?}, {}", inference_time.elapsed(), ra_prof::memory_usage()); |