post-incr

Crates.iopost-incr
lib.rspost-incr
version0.1.0
sourcesrc
created_at2021-05-28 09:50:54.959492
updated_at2021-05-28 09:50:54.959492
descriptionJust add traits for post increment and decrement.
homepage
repositoryhttps://github.com/VillSnow/post-incr-rs/
max_upload_size
id403046
size15,581
(VillSnow)

documentation

README

post-incr-rs

Just add traits for post increment and decrement.

use post_incr::PostIncr as _;
use post_incr::PostDecr as _;

let mut x: i32 = 0;
assert_eq!(x.post_incr(), 0);
assert_eq!(x.post_incr(), 1);
assert_eq!(x.post_incr(), 2);

assert_eq!(x.post_decr(), 3);
assert_eq!(x.post_decr(), 2);
assert_eq!(x.post_decr(), 1);
Commit count: 6

cargo fmt