Skip to content

Commit

Permalink
Merge pull request #608 from gvozdvmozgu/update-impl-infallible
Browse files Browse the repository at this point in the history
add impl `Update` for `std::convert::Infallible`
  • Loading branch information
Veykril authored Oct 27, 2024
2 parents 5eed7e9 + 8662fc6 commit dfbe6d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ pub unsafe trait Update {
unsafe fn maybe_update(old_pointer: *mut Self, new_value: Self) -> bool;
}

unsafe impl Update for std::convert::Infallible {
unsafe fn maybe_update(_old_pointer: *mut Self, new_value: Self) -> bool {
match new_value {}
}
}

unsafe impl<T> Update for Vec<T>
where
T: Update,
Expand Down

0 comments on commit dfbe6d6

Please sign in to comment.