2 unstable releases
Uses old Rust 2015
0.2.0 | Dec 7, 2015 |
---|---|
0.1.0 | Nov 19, 2015 |
#43 in #validator
4KB
81 lines
mynumber
My Number validator for Rust
Installation
Put this in your Cargo.toml
:
[dependencies]
mynumber = "0.1"
Usage
Put this in your crate root:
extern crate mynumber;
fn main() {
match mynumber::verify("123456789018") {
Ok(()) => println!("valid"),
Err(e) => println!("invalid: {:?}", e),
}
}
Verifying an Individual Number a.k.a My Number
extern crate mynumber;
use mynumber::individual;
fn main() {
match individual::verify("123456789018") {
Ok(()) => println!("valid"),
Err(e) => println!("invalid: {:?}", e),
}
}
Verifying a Corporate Number
extern crate mynumber;
use mynumber::corporate;
fn main() {
match corporate::verify("9234567890123") {
Ok(()) => println!("valid"),
Err(e) => println!("invalid: {:?}", e),
}
}
Contributing
Please check out the CONTIRBUTING guideline.
Acknowledgements
LICENSE
© 2015 Tomohiro TAIRA.
This project is licensed under the MIT license. See LICENSE for details.