Fix warnings in Wasm (#4778)

This commit is contained in:
Rushmore Mushambi 2024-09-16 16:49:55 +01:00 committed by GitHub
parent 3d505697de
commit 9af0082376
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 2 deletions

View file

@ -396,6 +396,7 @@ impl Iterator {
} }
/// Check if the iteration can be limited per iterator /// Check if the iteration can be limited per iterator
#[cfg(not(target_arch = "wasm32"))]
fn check_set_start_limit(&mut self, ctx: &Context, stm: &Statement<'_>) -> bool { fn check_set_start_limit(&mut self, ctx: &Context, stm: &Statement<'_>) -> bool {
// If there are groups we can't // If there are groups we can't
if stm.group().is_some() { if stm.group().is_some() {
@ -421,6 +422,7 @@ impl Iterator {
false false
} }
#[cfg(not(target_arch = "wasm32"))]
fn compute_start_limit(&mut self, ctx: &Context, stm: &Statement<'_>) { fn compute_start_limit(&mut self, ctx: &Context, stm: &Statement<'_>) {
if self.check_set_start_limit(ctx, stm) { if self.check_set_start_limit(ctx, stm) {
if let Some(l) = self.limit { if let Some(l) = self.limit {

View file

@ -1,3 +1,5 @@
#![cfg(not(target_arch = "wasm32"))]
use crate::ctx::Context; use crate::ctx::Context;
use crate::dbs::Options; use crate::dbs::Options;
use crate::err::Error; use crate::err::Error;

View file

@ -168,6 +168,7 @@ impl QueryPlanner {
&self.fallbacks &self.fallbacks
} }
#[cfg(not(target_arch = "wasm32"))]
pub(crate) fn is_order(&self, irf: &IteratorRef) -> bool { pub(crate) fn is_order(&self, irf: &IteratorRef) -> bool {
self.orders.contains(irf) self.orders.contains(irf)
} }

View file

@ -283,6 +283,7 @@ impl InfoStatement {
false => Value::from(res.to_string()), false => Value::from(res.to_string()),
}) })
} }
#[allow(unused_variables)]
InfoStatement::Index(index, table, _structured) => { InfoStatement::Index(index, table, _structured) => {
// Allowed to run? // Allowed to run?
opt.is_allowed(Action::View, ResourceKind::Actor, &Base::Db)?; opt.is_allowed(Action::View, ResourceKind::Actor, &Base::Db)?;

View file

@ -92,7 +92,7 @@ async fn router_handle_request(
response, response,
}: Route, }: Route,
state: &mut RouterState, state: &mut RouterState,
endpoint: &Endpoint, _endpoint: &Endpoint,
) -> HandleResult { ) -> HandleResult {
let RequestData { let RequestData {
id, id,
@ -209,7 +209,7 @@ async fn router_handle_request(
async fn router_handle_response( async fn router_handle_response(
response: Message, response: Message,
state: &mut RouterState, state: &mut RouterState,
endpoint: &Endpoint, _endpoint: &Endpoint,
) -> HandleResult { ) -> HandleResult {
match Response::try_from(&response) { match Response::try_from(&response) {
Ok(option) => { Ok(option) => {