diff --git a/crates/hyperlog-server/src/commands.rs b/crates/hyperlog-server/src/commands.rs index b1843e2..cb843fa 100644 --- a/crates/hyperlog-server/src/commands.rs +++ b/crates/hyperlog-server/src/commands.rs @@ -132,7 +132,7 @@ impl Commander { Ok(()) } - Command::Move { root, src, dest } => todo!(), + Command::Move { .. } => todo!(), } } } diff --git a/crates/hyperlog-server/src/services/create_item.rs b/crates/hyperlog-server/src/services/create_item.rs index 55dd16f..c2c4c01 100644 --- a/crates/hyperlog-server/src/services/create_item.rs +++ b/crates/hyperlog-server/src/services/create_item.rs @@ -28,13 +28,10 @@ struct ItemContent { #[derive(sqlx::FromRow)] struct Root { id: uuid::Uuid, - root_name: String, } #[derive(sqlx::FromRow)] -struct Section { - id: uuid::Uuid, -} +struct Section {} impl CreateItem { pub fn new(db: sqlx::PgPool) -> Self { diff --git a/crates/hyperlog-server/src/services/create_section.rs b/crates/hyperlog-server/src/services/create_section.rs index 8f39e39..fedb154 100644 --- a/crates/hyperlog-server/src/services/create_section.rs +++ b/crates/hyperlog-server/src/services/create_section.rs @@ -14,7 +14,6 @@ pub struct Response {} #[derive(sqlx::FromRow)] struct Root { id: uuid::Uuid, - root_name: String, } impl CreateSection { diff --git a/crates/hyperlog-server/src/services/get_available_roots.rs b/crates/hyperlog-server/src/services/get_available_roots.rs index 29354e5..d93d886 100644 --- a/crates/hyperlog-server/src/services/get_available_roots.rs +++ b/crates/hyperlog-server/src/services/get_available_roots.rs @@ -20,7 +20,7 @@ impl GetAvailableRoots { Self { db } } - pub async fn execute(&self, req: Request) -> anyhow::Result { + pub async fn execute(&self, _req: Request) -> anyhow::Result { let roots: Vec = sqlx::query_as( r#" SELECT diff --git a/crates/hyperlog-server/src/services/get_graph.rs b/crates/hyperlog-server/src/services/get_graph.rs index 875365b..0a011d3 100644 --- a/crates/hyperlog-server/src/services/get_graph.rs +++ b/crates/hyperlog-server/src/services/get_graph.rs @@ -35,7 +35,6 @@ struct Item { #[derive(sqlx::FromRow, Debug)] struct Node { - id: uuid::Uuid, path: String, item_type: String, item_content: Option>, @@ -152,12 +151,14 @@ mod engine { } impl Engine { + #[allow(dead_code)] pub fn engine_from_str(input: &str) -> anyhow::Result { let graph: Graph = serde_json::from_str(input)?; Ok(Self { graph }) } + #[allow(dead_code)] pub fn to_str(&self) -> anyhow::Result { serde_json::to_string_pretty(&self.graph).context("failed to serialize graph") } @@ -219,18 +220,21 @@ mod engine { root.get(path) } + #[allow(dead_code)] pub fn get_mut(&mut self, root: &str, path: &[&str]) -> Option<&mut GraphItem> { let root = self.graph.get_mut(root)?; root.get_mut(path) } + #[allow(dead_code)] pub fn take(&mut self, root: &str, path: &[&str]) -> Option { let root = self.graph.get_mut(root)?; root.take(path) } + #[allow(dead_code)] pub fn section_move( &mut self, root: &str, @@ -268,12 +272,14 @@ mod engine { Ok(()) } + #[allow(dead_code)] pub fn delete(&mut self, root: &str, path: &[&str]) -> anyhow::Result<()> { self.take(root, path) .map(|_| ()) .ok_or(anyhow!("item was not found")) } + #[allow(dead_code)] pub fn toggle_item(&mut self, root: &str, path: &[&str]) -> anyhow::Result<()> { if let Some(item) = self.get_mut(root, path) { match item { @@ -290,6 +296,7 @@ mod engine { Ok(()) } + #[allow(dead_code)] pub fn update_item( &mut self, root: &str, @@ -341,6 +348,7 @@ mod engine { Ok(()) } + #[allow(dead_code)] pub fn get_roots(&self) -> Option> { let items = self.graph.keys().cloned().collect::>(); if items.is_empty() { diff --git a/crates/hyperlog/src/cli.rs b/crates/hyperlog/src/cli.rs index 67b484a..ed4352d 100644 --- a/crates/hyperlog/src/cli.rs +++ b/crates/hyperlog/src/cli.rs @@ -1,3 +1,5 @@ +use std::net::SocketAddr; + use clap::{Parser, Subcommand, ValueEnum}; use hyperlog_tui::{ commander,