1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Replace TODO: with TODO(emilk): and update code guidelines

This commit is contained in:
Emil Ernerfeldt
2022-05-21 16:53:25 +02:00
parent 3d5e203d86
commit f3e305a646
60 changed files with 140 additions and 112 deletions

View File

@@ -145,7 +145,7 @@ pub fn format_with_decimals_in_range(value: f64, decimal_range: RangeInclusive<u
let min_decimals = min_decimals.min(max_decimals);
if min_decimals != max_decimals {
// Ugly/slow way of doing this. TODO: clean up precision.
// Ugly/slow way of doing this. TODO(emilk): clean up precision.
for decimals in min_decimals..max_decimals {
let text = format!("{:.*}", decimals, value);
let epsilon = 16.0 * f32::EPSILON; // margin large enough to handle most peoples round-tripping needs

View File

@@ -127,7 +127,7 @@ fn test_aim() {
assert_eq!(best_in_range_f64(12.3, 65.9), 50.0, "Prefer leading 5");
assert_eq!(best_in_range_f64(493.0, 879.0), 500.0, "Prefer leading 5");
assert_eq!(best_in_range_f64(0.37, 0.48), 0.40);
// assert_eq!(best_in_range_f64(123.71, 123.76), 123.75); // TODO: we get 123.74999999999999 here
// assert_eq!(best_in_range_f64(123.71, 123.76), 123.75); // TODO(emilk): we get 123.74999999999999 here
// assert_eq!(best_in_range_f32(123.71, 123.76), 123.75);
assert_eq!(best_in_range_f64(7.5, 16.3), 10.0);
assert_eq!(best_in_range_f64(7.5, 76.3), 10.0);