MCPcopy Create free account
hub / github.com/InkSha/rust-tutorial / save_todo_list

Function save_todo_list

src/todo/storage.rs:28–33  ·  view source on GitHub ↗
(save_file: &str, todos: &Vec<TodoItem>)

Source from the content-addressed store, hash-verified

26}
27
28pub fn save_todo_list(save_file: &str, todos: &Vec<TodoItem>) -> Result<(), String> {
29 let data = serde_json::to_string(todos).map_err(|e| e.to_string())?;
30 fs::write(save_file, data).map_err(|e| e.to_string())?;
31
32 Ok(())
33}

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected