You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let d = Distance::from_metres(100);
println!("{}", d.as_imperial()); // gives 109 yards, 1'1"
Will require fn as_imperial(&'a self) -> DistanceImperial<'a>, where DistanceImperial just holds a reference to the parent, and impl's Display. You could also have a metric version as_metric() which only gives one unit, but selects the appropriate SI scale (e.g. 33.3km, 33.3m, 33.3cm, 33.3mm, 33.3μm, etc).