From ff2094afedd008ba69a676963a9d77d820e480c4 Mon Sep 17 00:00:00 2001 From: Lucas Jeub Date: Fri, 15 Sep 2023 11:06:47 +0200 Subject: [PATCH] fix warnings --- examples/custom_python_extension/src/lib.rs | 2 +- python/src/graphql.rs | 2 +- raphtory-graphql/src/model/graph/graph.rs | 2 +- raphtory-graphql/src/model/mod.rs | 2 +- raphtory-graphql/src/server.rs | 2 +- raphtory/src/core/mod.rs | 5 ----- .../db/api/mutation/internal/internal_addition_ops.rs | 4 ++-- .../internal/internal_property_additions_ops.rs | 2 +- raphtory/src/db/api/mutation/mod.rs | 10 +++++++--- raphtory/src/db/api/mutation/property_addition_ops.rs | 1 - raphtory/src/db/api/view/internal/materialize.rs | 4 ++-- raphtory/src/db/graph/edge.rs | 7 ++----- raphtory/src/db/internal/addition.rs | 9 +++------ raphtory/src/db/internal/prop_add.rs | 4 ++-- 14 files changed, 24 insertions(+), 32 deletions(-) diff --git a/examples/custom_python_extension/src/lib.rs b/examples/custom_python_extension/src/lib.rs index 443ccd5787..32544ca621 100644 --- a/examples/custom_python_extension/src/lib.rs +++ b/examples/custom_python_extension/src/lib.rs @@ -11,7 +11,7 @@ fn py_custom_algorithm(graph: DynamicGraph) -> usize { } #[pymodule] -fn custom_python_extension(py: Python<'_>, m: &PyModule) -> PyResult<()> { +fn custom_python_extension(_py: Python<'_>, m: &PyModule) -> PyResult<()> { m.add_function(wrap_pyfunction!(py_custom_algorithm, m)?)?; Ok(()) } diff --git a/python/src/graphql.rs b/python/src/graphql.rs index e7e660dc48..048cd2050f 100644 --- a/python/src/graphql.rs +++ b/python/src/graphql.rs @@ -1,6 +1,6 @@ use pyo3::{exceptions, prelude::*}; use raphtory_core::{ - db::api::view::internal::{DynamicGraph, MaterializedGraph}, + db::api::view::internal::MaterializedGraph, prelude::Graph, python::{graph::graph::PyGraph, utils::errors::adapt_err_value}, }; diff --git a/raphtory-graphql/src/model/graph/graph.rs b/raphtory-graphql/src/model/graph/graph.rs index c6549d02a0..0e6838b634 100644 --- a/raphtory-graphql/src/model/graph/graph.rs +++ b/raphtory-graphql/src/model/graph/graph.rs @@ -19,7 +19,7 @@ use raphtory::{ }, graph::edge::EdgeView, }, - prelude::{EdgeViewOps, PropertyAdditionOps}, + prelude::EdgeViewOps, search::IndexedGraph, }; diff --git a/raphtory-graphql/src/model/mod.rs b/raphtory-graphql/src/model/mod.rs index 9bc9e10f96..929dd302f8 100644 --- a/raphtory-graphql/src/model/mod.rs +++ b/raphtory-graphql/src/model/mod.rs @@ -19,7 +19,7 @@ use dynamic_graphql::{ use itertools::Itertools; use raphtory::{ core::Prop, - db::api::view::internal::{CoreGraphOps, DynamicGraph, IntoDynamic, MaterializedGraph}, + db::api::view::internal::{CoreGraphOps, IntoDynamic, MaterializedGraph}, prelude::{Graph, GraphViewOps, PropertyAdditionOps}, search::IndexedGraph, }; diff --git a/raphtory-graphql/src/server.rs b/raphtory-graphql/src/server.rs index 7901e01211..5d79b2ab60 100644 --- a/raphtory-graphql/src/server.rs +++ b/raphtory-graphql/src/server.rs @@ -8,7 +8,7 @@ use crate::{ }; use async_graphql_poem::GraphQL; use poem::{get, listener::TcpListener, middleware::Cors, EndpointExt, Route, Server}; -use raphtory::{db::api::view::internal::DynamicGraph, prelude::Graph}; +use raphtory::prelude::Graph; use std::collections::HashMap; use tokio::{io::Result as IoResult, signal}; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Registry}; diff --git a/raphtory/src/core/mod.rs b/raphtory/src/core/mod.rs index 7532fcaa82..2ca3b87320 100644 --- a/raphtory/src/core/mod.rs +++ b/raphtory/src/core/mod.rs @@ -65,11 +65,6 @@ pub enum PropType { Graph, } -pub struct PropId { - id: usize, - dtype: PropType, -} - /// Denotes the types of properties allowed to be stored in the graph. #[derive(Debug, Serialize, Deserialize, PartialEq, Clone)] pub enum Prop { diff --git a/raphtory/src/db/api/mutation/internal/internal_addition_ops.rs b/raphtory/src/db/api/mutation/internal/internal_addition_ops.rs index cf429b5560..4664e32f7b 100644 --- a/raphtory/src/db/api/mutation/internal/internal_addition_ops.rs +++ b/raphtory/src/db/api/mutation/internal/internal_addition_ops.rs @@ -1,7 +1,7 @@ use crate::{ core::{ - entities::{edges::edge_store::EdgeStore, vertices::vertex_store::VertexStore, EID, VID}, - storage::{timeindex::TimeIndexEntry, EntryMut}, + entities::{EID, VID}, + storage::timeindex::TimeIndexEntry, utils::errors::GraphError, Prop, PropType, }, diff --git a/raphtory/src/db/api/mutation/internal/internal_property_additions_ops.rs b/raphtory/src/db/api/mutation/internal/internal_property_additions_ops.rs index 9d5c3c59e6..721f442971 100644 --- a/raphtory/src/db/api/mutation/internal/internal_property_additions_ops.rs +++ b/raphtory/src/db/api/mutation/internal/internal_property_additions_ops.rs @@ -2,7 +2,7 @@ use crate::{ core::{ entities::{EID, VID}, storage::timeindex::TimeIndexEntry, - utils::errors::{GraphError, IllegalMutate}, + utils::errors::GraphError, Prop, }, db::api::view::internal::Base, diff --git a/raphtory/src/db/api/mutation/mod.rs b/raphtory/src/db/api/mutation/mod.rs index 66f018c4d4..53662d416a 100644 --- a/raphtory/src/db/api/mutation/mod.rs +++ b/raphtory/src/db/api/mutation/mod.rs @@ -1,15 +1,19 @@ use crate::{ - core::utils::time::{error::ParseTimeError, TryIntoTime}, + core::{ + utils::{ + errors::GraphError, + time::{error::ParseTimeError, TryIntoTime}, + }, + PropType, + }, prelude::Prop, }; -use std::iter; mod addition_ops; mod deletion_ops; pub mod internal; mod property_addition_ops; -use crate::core::{utils::errors::GraphError, PropType}; pub use addition_ops::AdditionOps; pub use deletion_ops::DeletionOps; pub use property_addition_ops::PropertyAdditionOps; diff --git a/raphtory/src/db/api/mutation/property_addition_ops.rs b/raphtory/src/db/api/mutation/property_addition_ops.rs index 5035de89da..b8cd42d3de 100644 --- a/raphtory/src/db/api/mutation/property_addition_ops.rs +++ b/raphtory/src/db/api/mutation/property_addition_ops.rs @@ -2,7 +2,6 @@ use crate::{ core::{ storage::timeindex::TimeIndexEntry, utils::{errors::GraphError, time::TryIntoTime}, - Prop, }, db::api::mutation::{ internal::{InternalAdditionOps, InternalPropertyAdditionOps}, diff --git a/raphtory/src/db/api/view/internal/materialize.rs b/raphtory/src/db/api/view/internal/materialize.rs index ac1e6470db..9230e582b8 100644 --- a/raphtory/src/db/api/view/internal/materialize.rs +++ b/raphtory/src/db/api/view/internal/materialize.rs @@ -12,9 +12,9 @@ use crate::{ storage::{ locked_view::LockedView, timeindex::{LockedLayeredIndex, TimeIndex, TimeIndexEntry}, - ArcEntry, EntryMut, + ArcEntry, }, - utils::errors::{GraphError, IllegalMutate}, + utils::errors::GraphError, Direction, PropType, }, db::{ diff --git a/raphtory/src/db/graph/edge.rs b/raphtory/src/db/graph/edge.rs index 7835eb5d55..3877ad02bf 100644 --- a/raphtory/src/db/graph/edge.rs +++ b/raphtory/src/db/graph/edge.rs @@ -10,10 +10,7 @@ use crate::{ core::{ entities::{edges::edge_ref::EdgeRef, VID}, storage::{locked_view::LockedView, timeindex::TimeIndexEntry}, - utils::{ - errors::{GraphError, MutateGraphError}, - time::IntoTime, - }, + utils::{errors::GraphError, time::IntoTime}, }, db::{ api::{ @@ -116,7 +113,7 @@ impl EdgeVi props: C, layer: Option<&str>, ) -> Result<(), GraphError> { - let mut properties: Vec<(usize, Prop)> = props.collect_properties(|name, dtype| { + let properties: Vec<(usize, Prop)> = props.collect_properties(|name, dtype| { self.graph.resolve_edge_property(name, dtype, true) })?; let input_layer_id = self.resolve_layer(layer)?; diff --git a/raphtory/src/db/internal/addition.rs b/raphtory/src/db/internal/addition.rs index 59ad98ffca..3e2bd5cbec 100644 --- a/raphtory/src/db/internal/addition.rs +++ b/raphtory/src/db/internal/addition.rs @@ -1,15 +1,12 @@ use crate::{ core::{ - entities::{ - edges::edge_store::EdgeStore, graph::tgraph::InnerTemporalGraph, - vertices::vertex_store::VertexStore, EID, VID, - }, - storage::{timeindex::TimeIndexEntry, EntryMut}, + entities::{graph::tgraph::InnerTemporalGraph, EID, VID}, + storage::timeindex::TimeIndexEntry, utils::errors::GraphError, PropType, }, db::api::mutation::internal::InternalAdditionOps, - prelude::{Graph, Prop}, + prelude::Prop, }; use std::sync::atomic::Ordering; diff --git a/raphtory/src/db/internal/prop_add.rs b/raphtory/src/db/internal/prop_add.rs index 91268fa46b..f1d0c96566 100644 --- a/raphtory/src/db/internal/prop_add.rs +++ b/raphtory/src/db/internal/prop_add.rs @@ -1,8 +1,8 @@ use crate::{ core::{ entities::{graph::tgraph::InnerTemporalGraph, EID, VID}, - storage::{lazy_vec::IllegalSet, timeindex::TimeIndexEntry}, - utils::errors::{GraphError, IllegalMutate}, + storage::timeindex::TimeIndexEntry, + utils::errors::GraphError, }, db::api::{mutation::internal::InternalPropertyAdditionOps, view::internal::CoreGraphOps}, prelude::Prop,