resolve half of the integer_arithmetic lints, couple misc changes

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry
2024-05-03 21:42:47 -04:00
committed by June
parent ac4590952b
commit b5c0c30a5e
34 changed files with 188 additions and 109 deletions

View File

@@ -17,7 +17,7 @@ impl service::rooms::state_accessor::Data for KeyValueDatabase {
.expect("there is always one layer")
.1;
let mut result = HashMap::new();
let mut i = 0;
let mut i: u8 = 0;
for compressed in full_state.iter() {
let parsed = services()
.rooms
@@ -25,7 +25,7 @@ impl service::rooms::state_accessor::Data for KeyValueDatabase {
.parse_compressed_state_event(compressed)?;
result.insert(parsed.0, parsed.1);
i += 1;
i = i.saturating_add(1);
if i % 100 == 0 {
tokio::task::yield_now().await;
}
@@ -44,7 +44,7 @@ impl service::rooms::state_accessor::Data for KeyValueDatabase {
.1;
let mut result = HashMap::new();
let mut i = 0;
let mut i: u8 = 0;
for compressed in full_state.iter() {
let (_, eventid) = services()
.rooms
@@ -63,7 +63,7 @@ impl service::rooms::state_accessor::Data for KeyValueDatabase {
);
}
i += 1;
i = i.saturating_add(1);
if i % 100 == 0 {
tokio::task::yield_now().await;
}