From 892bfa0d3b70296218ba265525607121a9e3a39b Mon Sep 17 00:00:00 2001 From: Sebastian Kuzminsky Date: Sat, 8 Feb 2025 20:49:20 -0700 Subject: [PATCH] add a FIXME to coerce units --- tools/src/repo.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/src/repo.rs b/tools/src/repo.rs index dfd4f9a..9f3cb28 100644 --- a/tools/src/repo.rs +++ b/tools/src/repo.rs @@ -150,9 +150,12 @@ impl Repo { let output_quantity = output_info.quantity; // compute the "unit cost" of this input - let cost_each = cost / output_quantity.amount; let total_cost = amount_needed.amount * cost_each; + + // FIXME: Try to coerce the units here - if we buy + // hose in rolls measured in feet, but we use lengths + // of hose measured in meters, that should be ok. if let Some(output_unit) = output_info.quantity.unit { Some(format!( "${:.6} / {:?}\ntotal: ${:.6}",