~jplatte/const-unit-poc

5e23d45d3c54d6d46198fa618b22682a536d3f8f — Jonas Platte 5 months ago 8e53c58
Update code examples in README.md
1 files changed, 3 insertions(+), 3 deletions(-)

M README.md
M README.md => README.md +3 -3
@@ 6,7 6,7 @@ Correct usage:

```rust
#![feature(const_generics, const_evaluatable_checked)]
use const_unit_poc::values::{m, kg, s, N};
use const_unit_poc::values::{cm, kg, m, s, N};

let distance = 1.0 * m;
let mass = 18.0 * kg;


@@ 14,7 14,7 @@ let force = distance * mass / (1.8 * s * 2.0 * s);
assert_eq!(force, 5.0 * N);

let mut mutable_distance = 3.2 * m;
mutable_distance -= 0.2 * m;
mutable_distance -= 20.0 * cm;
mutable_distance += 2.0 * m;

assert_eq!(mutable_distance, 5.0 * m);


@@ 24,7 24,7 @@ Wrong usage:

```rust
#![feature(const_generics, const_evaluatable_checked)]
use const_unit_poc::{units, values::kg, Quantity};
use const_unit_poc::values::{kg, m};

let mut distance = 15.0 * m;
distance = 2.0 * kg;