Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return a boolean from
set_if_neq
(#9801)
# Objective When using `set_if_neq`, sometimes you'd like to know if the new value was different from the old value so that you can perform some additional branching. ## Solution Return a bool from this function, which indicates whether or not the value was overwritten. --- ## Changelog * `DetectChangesMut::set_if_neq` now returns a boolean indicating whether or not the value was changed. ## Migration Guide The trait method `DetectChangesMut::set_if_neq` now returns a boolean value indicating whether or not the value was changed. If you were implementing this function manually, you must now return `true` if the value was overwritten and `false` if the value was not.
- Loading branch information