An implementation of Serial Number Arithmetic as defined by RFC 1982 for Rust.
Add this to your Cargo.toml
:
[dependencies]
sna = "0.1"
Add this to your crate:
extern crate sna;
use sna::SerialNumber;
let zero = SerialNumber(0u8);
let one = SerialNumber(1u8);
assert_eq!(0u8, one + 255u8);
assert!(zero > 255u8);
To run clippy lints, compile the library with --features clippy
on a nightly
compiler:
$ cargo build --features clippy
If nightly
is not your default compiler:
$ rustup run nightly cargo build --features clippy