substrace icon indicating copy to clipboard operation
substrace copied to clipboard

Lint for missing storage write-back

Open ggwpez opened this issue 2 years ago • 0 comments
trafficstars

Often a storage value is first loaded, modify it and then hopefully written back to storage. A lint could be added which checks that modified values from storage are written back. Example:

let mut val = Value::<T>::get();
val += 123;
…
Value::<T>::set(&val); // Errors if this line is missing.

No idea how difficult that is to implement, just wanted to drop that idea.

ggwpez avatar Feb 28 '23 19:02 ggwpez