Merge pull request #608 from gvozdvmozgu/update-impl-infallible
Some checks failed
Book / Book (push) Has been cancelled
Test / Test (false, beta) (push) Has been cancelled
Test / Test (false, stable) (push) Has been cancelled
Test / Test (true, nightly) (push) Has been cancelled
Test / Miri (push) Has been cancelled
Test / Benchmarks (push) Has been cancelled
Book / Deploy (push) Has been cancelled

add impl `Update` for `std::convert::Infallible`
This commit is contained in:
Lukas Wirth 2024-10-27 08:03:21 +00:00 committed by GitHub
commit dfbe6d67f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,