Skip to content

Commit 9b62a4e

Browse files
committed
appease clippy
1 parent b8d2191 commit 9b62a4e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/impl_/pymodule.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,14 +315,14 @@ impl PyModuleSlotsBuilder {
315315
}
316316

317317
pub const fn build(self) -> PyModuleSlots {
318-
// Required to guarantee there's still a zeroed element
319-
// at the end
320318
PyModuleSlots(UnsafeCell::new(self.values))
321319
}
322320

323321
const fn push(mut self, slot: c_int, value: *mut c_void) -> Self {
322+
// Required to guarantee there's still a zeroed element
323+
// at the end
324324
assert!(
325-
self.len + 1 <= MAX_SLOTS,
325+
self.len < MAX_SLOTS,
326326
"Cannot add more than MAX_SLOTS slots to a PyModuleSlots",
327327
);
328328
self.values[self.len] = ffi::PyModuleDef_Slot { slot, value };

0 commit comments

Comments
 (0)