From fd6a67962065fb460f4389dbd95c71ef301c0002 Mon Sep 17 00:00:00 2001 From: Warren Date: Sun, 17 May 2026 02:30:37 +0800 Subject: [PATCH] fix: Fix node_id string slice syntax error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Final fix for compilation: - node_id generation: uuid[0..8] → chars().take(8).collect() - Split into two lines for clarity: let uuid_str = uuid::Uuid::new_v4().to_string().replace('-', ); let node_id = format!("node-{}", uuid_str.chars().take(8).collect::()); Compilation now successful ✅ All string slice errors fixed ✅ Files: - src/server.rs (line 836-837: node_id generation) --- src/server.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server.rs b/src/server.rs index e3a3f84..532874e 100644 --- a/src/server.rs +++ b/src/server.rs @@ -860,7 +860,8 @@ async fn upload_file( )?; // Create file node - let node_id = format!("node-{}", uuid::Uuid::new_v4().to_string().replace('-', "")[0..8]); + let uuid_str = uuid::Uuid::new_v4().to_string().replace('-', ""); + let node_id = format!("node-{}", uuid_str.chars().take(8).collect::()); conn.execute( "INSERT INTO file_nodes (node_id, label, file_uuid, sha256, node_type, file_size, created_at, updated_at)