We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7ff5bbd + 4ca1277 commit d30776eCopy full SHA for d30776e
src/librustc/middle/borrowck/mod.rs
@@ -98,9 +98,9 @@ pub fn check_crate(tcx: &ty::ctxt,
98
}
99
100
fn make_stat(bccx: &BorrowckCtxt, stat: uint) -> String {
101
- let stat_f = stat as f64;
102
let total = bccx.stats.guaranteed_paths.get() as f64;
103
- format!("{} ({:.0f}%)", stat , stat_f * 100.0 / total)
+ let perc = if total == 0.0 { 0.0 } else { stat as f64 * 100.0 / total };
+ format!("{} ({:.0f}%)", stat, perc)
104
105
106
0 commit comments