Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkooo committed Sep 12, 2024
1 parent 9e0283d commit 365af7f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions crates/torii/grpc/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ impl DojoWorld {
"#
);
// total count of rows without limit and offset
let total_count: u32 = sqlx::query_scalar(&count_query).fetch_optional(&self.pool).await?.unwrap_or(0);
let total_count: u32 =
sqlx::query_scalar(&count_query).fetch_optional(&self.pool).await?.unwrap_or(0);

Check warning on line 261 in crates/torii/grpc/src/server/mod.rs

View check run for this annotation

Codecov / codecov/patch

crates/torii/grpc/src/server/mod.rs#L260-L261

Added lines #L260 - L261 were not covered by tests

if total_count == 0 {
return Ok((Vec::new(), 0));
Expand Down Expand Up @@ -375,8 +376,11 @@ impl DojoWorld {
}
);

let total_count =
sqlx::query_scalar(&count_query).bind(&keys_pattern).fetch_optional(&self.pool).await?.unwrap_or(0);
let total_count = sqlx::query_scalar(&count_query)
.bind(&keys_pattern)
.fetch_optional(&self.pool)
.await?
.unwrap_or(0);

if total_count == 0 {
return Ok((Vec::new(), 0));
Expand Down Expand Up @@ -521,8 +525,9 @@ impl DojoWorld {
"#,
compute_selector_from_names(namespace, model)
);

let models_result: Option<(String,)> = sqlx::query_as(&models_query).fetch_optional(&self.pool).await?;

let models_result: Option<(String,)> =
sqlx::query_as(&models_query).fetch_optional(&self.pool).await?;

Check warning on line 530 in crates/torii/grpc/src/server/mod.rs

View check run for this annotation

Codecov / codecov/patch

crates/torii/grpc/src/server/mod.rs#L529-L530

Added lines #L529 - L530 were not covered by tests
// we return an empty array of entities if the table is empty
if models_result.is_none() {
return Ok((Vec::new(), 0));
Expand Down

0 comments on commit 365af7f

Please sign in to comment.