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:
@@ -860,7 +860,8 @@ async fn upload_file(
|
|||||||
)?;
|
)?;
|
||||||
|
|
||||||
// Create file node
|
// 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(
|
conn.execute(
|
||||||
"INSERT INTO file_nodes (node_id, label, file_uuid, sha256, node_type, file_size, created_at, updated_at)
|
"INSERT INTO file_nodes (node_id, label, file_uuid, sha256, node_type, file_size, created_at, updated_at)
|
||||||
|
|||||||
Reference in New Issue
Block a user