enable as_conversions lint

There were some very, uh, creative (and inconsistent) ways to convert
between numeric types in here...
This commit is contained in:
Charles Hall 2024-05-12 15:32:23 -07:00
parent a78bf8f50b
commit 71c48f66c4
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
21 changed files with 195 additions and 91 deletions

View file

@ -44,6 +44,9 @@ impl Service {
let mut i = 0;
for id in starting_events {
let short = services().rooms.short.get_or_create_shorteventid(&id)?;
// I'm afraid to change this in case there is accidental reliance on
// the truncation
#[allow(clippy::as_conversions, clippy::cast_possible_truncation)]
let bucket_id = (short % NUM_BUCKETS as u64) as usize;
buckets[bucket_id].insert((short, id.clone()));
i += 1;