strict-typing 0.1.0

A procedural macro for ensuring strict type safety.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use strict_typing::strict_types;

struct Distance(f64);
struct Duration(f64);
struct Speed(f64);

#[strict_types]
fn compute_speed(d: Distance, t: Duration) -> Speed {
    Speed(d.0 / t.0)
}

fn main() {
    let _ = compute_speed(Distance(100.0), Duration(10.0));
}