num_alias

Crates.ionum_alias
lib.rsnum_alias
version0.1.7
sourcesrc
created_at2018-01-06 16:46:34.936946
updated_at2018-01-09 10:45:58.751658
descriptionsimple macros to declare 'type checked' aliases for integers and floats.
homepage
repositoryhttps://github.com/kngwyu/num-alias
max_upload_size
id45732
size11,922
Yuji Kanagawa (kngwyu)

documentation

README

num_alias

Crates.io: num_alias Documentation Build Status License: MIT Provides simple and useful macros to declare 'type and range checked' aliases for integers and floats.

#[macro_use]
extern crate num_alias;
fn main() {
    // declare alias with range[3, 6)
    int_alias!(Val, i32, 3 => 6);
    let a = Val(5);
    let b = Val(4);
    // this code panics
    let c = a * b;
}
Commit count: 26

cargo fmt