Rust ships with non-zero integer types now, which let programmers promise (memory-savingly!) that a number can never be zero. That's great, but sadly the standard library has no traits you can use to represent all the non-zero integer types.
Where this lack of traits in the standard library becomes problematic is if you want to write a function that takes a vector of integers, and that returns a vector of the corresponding non-zero integer types, minus any elements that were zero in the original. You can write that with the standard library quite easily for concrete types:
``` rust
fn onlynonzeros(v: Vec
But what if you want to allow this function to work with any integer type that has a corresponding non-zero type? This crate can help:
``` rust
fn onlynonzeros(v: Vec) -> Vec
// It works for u8
:
let inputu8: Vec
// And it works for u32
:
let inputu32: Vec
License: Apache-2.0