Simplify modify function from 5 to 2 lines of code
@@ -49,10 +49,7 @@ pub fn render(
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W
{
let bits = self.register.get();
- let r = R { bits };
- let mut w = W { bits };
- f(&r, &mut w);
- self.register.set(w.bits);
+ self.register.set(f(&R { bits }, &mut W { bits }).bits);
}
});
}
