1 2 3 4 5 6 7 8 9 10 11
pub trait Postincrement { fn postincrement(&mut self) -> Self; } impl Postincrement for u32 { fn postincrement(&mut self) -> Self { let value = *self; *self += 1; value } }