Trait PostDecr
post_incr
pub trait PostDecr { fn post_decr(&mut self) -> Self; }
fn post_decr(&mut self) -> Self
x-- in other language.
x--
use post_incr::PostDecr as _; let mut x: i32 = 0; assert_eq!(x.post_decr(), 0); assert_eq!(x.post_decr(), -1); assert_eq!(x.post_decr(), -2);
impl<T> PostDecr for T where Self: Copy + SubAssign + One,