integer-iterator 0.3.0

Add the ability to iterate over the digit of all primitive integer types. Also exposes the trait so one can implement it oneself.
Documentation
  • Coverage
  • 50%
    2 out of 4 items documented1 out of 3 items with examples
  • Size
  • Source code size: 6.06 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 8.33 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • hbina/integer-iterator
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • hbina

integer-iterator

Crates.io

Implement Iterator over primitive integer types in Rust. Also, this crate exposes the trait so one can implement it for any desired types.

Examples

    let mut positive = 1234u32.digits();
    assert_eq!(positive.next(), Some(4));
    assert_eq!(positive.next(), Some(3));
    assert_eq!(positive.next(), Some(2));
    assert_eq!(positive.next(), Some(1));

    let mut negative = (-1234i32).digits();
    assert_eq!(negative.next(), Some(4));
    assert_eq!(negative.next(), Some(3));
    assert_eq!(negative.next(), Some(2));
    assert_eq!(negative.next(), Some(1));