Add link to related code

This commit is contained in:
Austen Adler 2021-05-03 00:49:08 -04:00
parent 85ea8ca776
commit 06c4ab6b55

View File

@ -405,6 +405,7 @@ fn draw_clippy_rect<T: std::io::Write>(c: ClippyRectangle, f: &mut Frame<Termion
f.render_widget(help_message, area); f.render_widget(help_message, area);
} }
// Based on https://stackoverflow.com/a/65266882
fn fmt_scientific(i: usize, f: f64, precision: usize) -> String { fn fmt_scientific(i: usize, f: f64, precision: usize) -> String {
let mut ret = format!("{:.precision$e}", f, precision = precision); let mut ret = format!("{:.precision$e}", f, precision = precision);
let exp = ret.split_off(ret.find('e').unwrap_or(0)); let exp = ret.split_off(ret.find('e').unwrap_or(0));