We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a3638d commit c4f67c1Copy full SHA for c4f67c1
mappings/src/lib.rs
@@ -247,7 +247,7 @@ mod enabled {
247
/// Increases `p` as little as possible (including possibly 0)
248
/// such that it becomes a multiple of `N`.
249
pub const fn align_up<const N: usize>(p: usize) -> usize {
250
- if p % N == 0 {
+ if p.is_multiple_of(N) {
251
p
252
} else {
253
p + (N - (p % N))
@@ -268,7 +268,7 @@ mod enabled {
268
let align = std::mem::align_of::<T>();
269
270
assert!(!ptr.is_null());
271
- assert!(address % align == 0, "unaligned pointer");
+ assert!(address.is_multiple_of(align), "unaligned pointer");
272
}
273
274
fn current_exe_from_dladdr() -> Result<PathBuf, anyhow::Error> {
0 commit comments