From 283cb8f554272ca33d705f49a384d73071ed6971 Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Mon, 30 Mar 2026 16:17:16 +0200 Subject: [PATCH] refactor: remove dead code from url_protector and rolegraph - Remove unused _placeholder_counter field from UrlProtector struct (was declared but never read) - Remove commented-out parse_document_to_pair method from RoleGraph (superseded by insert_document) Refs #135 Co-Authored-By: Terraphim AI --- crates/terraphim_automata/src/url_protector.rs | 17 +++-------------- crates/terraphim_rolegraph/src/lib.rs | 9 --------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/crates/terraphim_automata/src/url_protector.rs b/crates/terraphim_automata/src/url_protector.rs index 486ae4102..693ebd2d7 100644 --- a/crates/terraphim_automata/src/url_protector.rs +++ b/crates/terraphim_automata/src/url_protector.rs @@ -60,24 +60,13 @@ pub struct ProtectedUrl { } /// URL protector for masking and restoring URLs during text replacement. -#[derive(Debug, Clone)] -pub struct UrlProtector { - /// Counter for generating unique placeholders - _placeholder_counter: u32, -} - -impl Default for UrlProtector { - fn default() -> Self { - Self::new() - } -} +#[derive(Debug, Clone, Default)] +pub struct UrlProtector; impl UrlProtector { /// Create a new URL protector. pub fn new() -> Self { - Self { - _placeholder_counter: 0, - } + Self } /// Mask all URLs in the text with placeholders. diff --git a/crates/terraphim_rolegraph/src/lib.rs b/crates/terraphim_rolegraph/src/lib.rs index cefd2c221..716fa7c7e 100644 --- a/crates/terraphim_rolegraph/src/lib.rs +++ b/crates/terraphim_rolegraph/src/lib.rs @@ -1031,15 +1031,6 @@ impl RoleGraph { Ok(documents) } - // pub fn parse_document_to_pair(&mut self, document_id: &str, text: &str) { - // let matches = self.find_matching_node_ids(text); - // for (a, b) in matches.into_iter().tuple_windows() { - // // cast to Id - // let a = a as Id; - // self.add_or_update_document(document_id, a, b); - // } - // } - /// Inserts an document into the rolegraph pub fn insert_document(&mut self, document_id: &str, document: Document) { self.documents.insert(