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
In the following example, i want to return a value from bar with some L³/T² units, let's say m³/s².
I did not find any consistent unit I could use. And I don't know how to define my own.
use uom::si::f64::{Time,Volume,VolumeRate};use uom::si::time::second;use uom::si::volume::cubic_meter;fnfoo(time:Time,volume:Volume) -> VolumeRate{
volume / time // returns a VolumeRate}fnbar(time:Time,volume_rate:VolumeRate)/* -> MyUnit */{
volume_rate / time;// I want to remove the semicolon}fnmain(){let time = Time::new::<second>(6.0);let volume = Volume::new::<cubic_meter>(80.0);let volume_rate = foo(time, volume);println!("{:?}", volume_rate);let quantity = bar(time, volume_rate);println!("{:?}", quantity);}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
In the following example, i want to return a value from
bar
with some L³/T² units, let's say m³/s².I did not find any consistent unit I could use. And I don't know how to define my own.
Beta Was this translation helpful? Give feedback.
All reactions