From 2f9a2d866844d361cd8a7c1eb5a7965ab2ac3028 Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Thu, 16 Oct 2025 01:41:12 +0300 Subject: [PATCH] fix format and serde for ORM --- app/nextgraph/src-tauri/src/lib.rs | 5 ----- engine/net/Cargo.toml | 2 +- engine/oxigraph/src/oxigraph/storage/mod.rs | 9 +-------- engine/verifier/src/inbox_processor.rs | 9 ++++----- engine/verifier/src/orm/mod.rs | 3 --- sdk/python/src/lib.rs | 15 ++++++++++----- 6 files changed, 16 insertions(+), 27 deletions(-) diff --git a/app/nextgraph/src-tauri/src/lib.rs b/app/nextgraph/src-tauri/src/lib.rs index ab73162..3a91050 100644 --- a/app/nextgraph/src-tauri/src/lib.rs +++ b/app/nextgraph/src-tauri/src/lib.rs @@ -34,11 +34,6 @@ use ng_wallet::*; use nextgraph::local_broker::*; -#[cfg(mobile)] -mod mobile; -#[cfg(mobile)] -pub use mobile::*; - pub type SetupHook = Box Result<(), Box> + Send>; #[tauri::command(rename_all = "snake_case")] diff --git a/engine/net/Cargo.toml b/engine/net/Cargo.toml index ad4a3cb..233f40f 100644 --- a/engine/net/Cargo.toml +++ b/engine/net/Cargo.toml @@ -17,7 +17,7 @@ rust-version.workspace = true maintenance = { status = "actively-developed" } [dependencies] -serde = { version = "1.0", features = ["derive"] } +serde = { version = "1.0", features = ["derive","rc"] } serde_bare = "0.5.0" serde_bytes = "0.11.7" serde_json = "1.0" diff --git a/engine/oxigraph/src/oxigraph/storage/mod.rs b/engine/oxigraph/src/oxigraph/storage/mod.rs index 7fe66c7..29846a0 100644 --- a/engine/oxigraph/src/oxigraph/storage/mod.rs +++ b/engine/oxigraph/src/oxigraph/storage/mod.rs @@ -2187,14 +2187,7 @@ impl<'a> StorageWriter<'a> { let value = [value]; self.buffer.clear(); write_spog_quad(&mut self.buffer, encoded); - let result = - // if self - // .transaction - // .contains_key_for_update(&self.storage.spog_cf, &self.buffer)? - // { - // false - // } else - { + let result = { self.transaction .insert(&self.storage.spog_cf, &self.buffer, &value)?; diff --git a/engine/verifier/src/inbox_processor.rs b/engine/verifier/src/inbox_processor.rs index 0393217..fbcbe46 100644 --- a/engine/verifier/src/inbox_processor.rs +++ b/engine/verifier/src/inbox_processor.rs @@ -537,8 +537,8 @@ impl Verifier { OPTIONAL {{ <> ng:social_query_forwarder ?from_forwarder .}} OPTIONAL {{ <> ng:social_query_ended ?ended . }} }}".to_string(), - Some(forwarder_nuri_string)).await? - { + Some(forwarder_nuri_string) + ).await? { QueryResults::Solutions(mut sols) => { match sols.next() { None => { @@ -570,11 +570,10 @@ impl Verifier { } else { None }; - (from_profile, from_inbox, from_forwarder) } - } - } + } + }, _ => return Err(VerifierError::SparqlError(NgError::InvalidResponse.to_string())), }; diff --git a/engine/verifier/src/orm/mod.rs b/engine/verifier/src/orm/mod.rs index 9e921ec..1a2a842 100644 --- a/engine/verifier/src/orm/mod.rs +++ b/engine/verifier/src/orm/mod.rs @@ -18,7 +18,6 @@ pub mod types; pub mod utils; pub use ng_net::orm::{OrmDiff, OrmShapeType}; -use std::collections::HashMap; use crate::orm::types::*; use crate::verifier::*; @@ -31,5 +30,3 @@ impl Verifier { }); } } - -// Btw, orm/mod.rs is exceeding 1200 lines again. Is that a good practice? I have the feeling, we could separate a couple of things.. diff --git a/sdk/python/src/lib.rs b/sdk/python/src/lib.rs index aba840d..bdd3aba 100644 --- a/sdk/python/src/lib.rs +++ b/sdk/python/src/lib.rs @@ -25,7 +25,7 @@ use ::nextgraph::net::app_protocol::*; use ::nextgraph::net::types::BootstrapContentV0; use ::nextgraph::repo::errors::NgError; use ::nextgraph::repo::log::*; -use ::nextgraph::repo::types::{BranchCrdt, StoreRepo, PubKey}; +use ::nextgraph::repo::types::{BranchCrdt, PubKey, StoreRepo}; use ::nextgraph::wallet::types::{CreateWalletV0, SessionInfo}; use ::nextgraph::wallet::{display_mnemonic, emojis::display_pazzle}; use async_std::stream::StreamExt; @@ -149,11 +149,16 @@ fn doc_create( store_repo: Option, ) -> PyResult> { pyo3_async_runtimes::async_std::future_into_py(py, async move { - - Ok(nextgraph::local_broker::doc_create(session_id, crdt, class_name, destination, store_type, store_repo) - .await - .map_err(|e| Into::::into(e))? + Ok(nextgraph::local_broker::doc_create( + session_id, + crdt, + class_name, + destination, + store_type, + store_repo, ) + .await + .map_err(|e| Into::::into(e))?) }) }