1pub trait Apply<D> { 2 fn apply(&mut self, diff: D); 3} 4 5impl<T> Apply<T> for T { 6 fn apply(&mut self, diff: T) { 7 *self = diff; 8 } 9}