Skip to content

Commit

Permalink
docs(README): added unit conversion example
Browse files Browse the repository at this point in the history
  • Loading branch information
igiona committed Nov 3, 2023
1 parent 629f385 commit d24fc1b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ fn main() {
let velocity/*: Velocity*/ = length / time;
let _acceleration = calc_acceleration(velocity, time);
//let error = length + time; // error[E0308]: mismatched types

// Get a quantity value in a specific unit.
let time_in_nano_seconds = time.get::<uom::si::time::nanosecond>();
}

fn calc_acceleration(velocity: Velocity, time: Time) -> Acceleration {
Expand Down

0 comments on commit d24fc1b

Please sign in to comment.