From eb65fdef7a1af1c5d8b54eec598672436eac88ca Mon Sep 17 00:00:00 2001 From: Brayo Date: Sat, 13 Jun 2026 15:26:37 +0300 Subject: [PATCH] fix: resolve cargo build warnings --- aw-datastore/src/legacy_import.rs | 2 ++ aw-datastore/src/privacy_filter.rs | 2 ++ aw-models/src/tryvec.rs | 1 + aw-query/src/ast.rs | 1 + aw-sync/src/accessmethod.rs | 7 ------- aw-sync/src/dirs.rs | 1 + 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/aw-datastore/src/legacy_import.rs b/aw-datastore/src/legacy_import.rs index be6f5d282..a4043488b 100644 --- a/aw-datastore/src/legacy_import.rs +++ b/aw-datastore/src/legacy_import.rs @@ -3,7 +3,9 @@ use rusqlite::Connection; #[derive(Debug, Clone)] pub enum LegacyDatastoreImportError { + #[allow(dead_code)] SQLPrepareError(String), + #[allow(dead_code)] SQLMapError(String), } diff --git a/aw-datastore/src/privacy_filter.rs b/aw-datastore/src/privacy_filter.rs index 4d53136b9..634e8693f 100644 --- a/aw-datastore/src/privacy_filter.rs +++ b/aw-datastore/src/privacy_filter.rs @@ -113,6 +113,7 @@ impl PrivacyFilterEngine { /// Example rules for common sensitive data patterns. /// Not applied automatically — use `new()` with these rules to opt in. + #[allow(dead_code)] pub fn with_defaults() -> Self { let rules = vec![ PrivacyFilterRule { @@ -173,6 +174,7 @@ impl PrivacyFilterEngine { } /// Serialize rules to JSON string. + #[allow(dead_code)] pub fn to_json(&self) -> Result { serde_json::to_string(&self.rules) .map_err(|e| format!("Failed to serialize privacy filter rules: {e}")) diff --git a/aw-models/src/tryvec.rs b/aw-models/src/tryvec.rs index 60716ce4d..4b3bf1a10 100644 --- a/aw-models/src/tryvec.rs +++ b/aw-models/src/tryvec.rs @@ -10,6 +10,7 @@ use std::fmt::Debug; #[derive(Debug, Clone)] pub enum TryParse { Parsed(T), + #[allow(dead_code)] Unparsed(Value), NotPresent, } diff --git a/aw-query/src/ast.rs b/aw-query/src/ast.rs index bba165578..0a45d78dc 100644 --- a/aw-query/src/ast.rs +++ b/aw-query/src/ast.rs @@ -9,6 +9,7 @@ pub struct Program { #[derive(Debug, Clone)] pub struct Expr { + #[allow(dead_code)] pub span: Span, pub node: Expr_, } diff --git a/aw-sync/src/accessmethod.rs b/aw-sync/src/accessmethod.rs index 793ba5db1..6096d4c9f 100644 --- a/aw-sync/src/accessmethod.rs +++ b/aw-sync/src/accessmethod.rs @@ -22,7 +22,6 @@ pub trait AccessMethod: std::fmt::Debug { fn insert_events(&self, bucket_id: &str, events: Vec) -> Result<(), String>; fn get_event_count(&self, bucket_id: &str) -> Result; fn heartbeat(&self, bucket_id: &str, event: Event, duration: f64) -> Result<(), String>; - fn close(&self); } impl AccessMethod for Datastore { @@ -59,9 +58,6 @@ impl AccessMethod for Datastore { fn get_event_count(&self, bucket_id: &str) -> Result { Ok(Datastore::get_event_count(self, bucket_id, None, None).unwrap()) } - fn close(&self) { - Datastore::close(self); - } } impl AccessMethod for AwClient { @@ -108,7 +104,4 @@ impl AccessMethod for AwClient { fn heartbeat(&self, bucket_id: &str, event: Event, duration: f64) -> Result<(), String> { AwClient::heartbeat(self, bucket_id, &event, duration).map_err(|e| format!("{e:?}")) } - fn close(&self) { - // NOP - } } diff --git a/aw-sync/src/dirs.rs b/aw-sync/src/dirs.rs index 2744bba65..1e072ae00 100644 --- a/aw-sync/src/dirs.rs +++ b/aw-sync/src/dirs.rs @@ -17,6 +17,7 @@ pub fn get_config_dir() -> Result> { } #[cfg(not(target_os = "android"))] +#[allow(dead_code)] pub fn get_server_config_path(testing: bool) -> Result { let dir = aw_server::dirs::get_config_dir()?; Ok(dir.join(if testing {