1
Fork 0

Apply suggestions from code review

Co-authored-by: Ralf Jung <post@ralfj.de>
This commit is contained in:
Christopher Durham 2021-01-13 17:21:23 -05:00 committed by GitHub
parent b5b6760c03
commit c14e919f1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -1881,7 +1881,7 @@ impl<T: ?Sized> Weak<T> {
if is_dangling(ptr) { if is_dangling(ptr) {
// If the pointer is dangling, we return the sentinel directly. This cannot be // If the pointer is dangling, we return the sentinel directly. This cannot be
// a valid payload address, as it is at least as aligned as RcBox (usize). // a valid payload address, as the payload is at least as aligned as RcBox (usize).
ptr as *const T ptr as *const T
} else { } else {
// SAFETY: if is_dangling returns false, then the pointer is dereferencable. // SAFETY: if is_dangling returns false, then the pointer is dereferencable.

View file

@ -1666,7 +1666,7 @@ impl<T: ?Sized> Weak<T> {
if is_dangling(ptr) { if is_dangling(ptr) {
// If the pointer is dangling, we return the sentinel directly. This cannot be // If the pointer is dangling, we return the sentinel directly. This cannot be
// a valid payload address, as it is at least as aligned as ArcInner (usize). // a valid payload address, as the payload is at least as aligned as ArcInner (usize).
ptr as *const T ptr as *const T
} else { } else {
// SAFETY: if is_dangling returns false, then the pointer is dereferencable. // SAFETY: if is_dangling returns false, then the pointer is dereferencable.