Implement ptr.is_aligned()
in terms of .is_aligned_to()
This commit is contained in:
parent
a908eec438
commit
6c1ebff59e
@ -1301,7 +1301,7 @@ pub fn is_aligned(self) -> bool
|
||||
where
|
||||
T: Sized,
|
||||
{
|
||||
self.addr() % core::mem::align_of::<T>() == 0
|
||||
self.is_aligned_to(core::mem::align_of::<T>())
|
||||
}
|
||||
|
||||
/// Returns whether the pointer is aligned to `align`.
|
||||
|
@ -1570,7 +1570,7 @@ pub fn is_aligned(self) -> bool
|
||||
where
|
||||
T: Sized,
|
||||
{
|
||||
self.addr() % core::mem::align_of::<T>() == 0
|
||||
self.is_aligned_to(core::mem::align_of::<T>())
|
||||
}
|
||||
|
||||
/// Returns whether the pointer is aligned to `align`.
|
||||
|
Loading…
Reference in New Issue
Block a user