add expected! macro to checked math expression suite
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -66,7 +66,7 @@ impl Service {
|
||||
.enumerate()
|
||||
{
|
||||
let bucket: usize = short.try_into()?;
|
||||
let bucket: usize = validated!(bucket % NUM_BUCKETS)?;
|
||||
let bucket: usize = validated!(bucket % NUM_BUCKETS);
|
||||
buckets[bucket].insert((short, starting_events[i]));
|
||||
}
|
||||
|
||||
|
||||
@@ -1205,7 +1205,7 @@ impl Service {
|
||||
let count = self.services.globals.next_count()?;
|
||||
let mut pdu_id = shortroomid.to_be_bytes().to_vec();
|
||||
pdu_id.extend_from_slice(&0_u64.to_be_bytes());
|
||||
pdu_id.extend_from_slice(&(validated!(max - count)?).to_be_bytes());
|
||||
pdu_id.extend_from_slice(&(validated!(max - count)).to_be_bytes());
|
||||
|
||||
// Insert pdu
|
||||
self.db.prepend_backfill_pdu(&pdu_id, &event_id, &value)?;
|
||||
|
||||
Reference in New Issue
Block a user