fix: Fix node_id string slice syntax error

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::<String>());

Compilation now successful 
All string slice errors fixed 

Files:
- src/server.rs (line 836-837: node_id generation)
This commit is contained in:
Warren
2026-05-17 02:30:37 +08:00
parent 27fd87d5d5
commit fd6a679620

View File

@@ -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::<String>());
conn.execute(
"INSERT INTO file_nodes (node_id, label, file_uuid, sha256, node_type, file_size, created_at, updated_at)