czwjss-todo-cli 0.1.5
“练手用命令行任务清单工具(Rust 版本)”
Reads a file into a Rust stringRust reads an environment variable
SHA-25650a48d7823e23c01d28b1cd0ae9cbae78e32e5a638304ced12dffa72cf4370dc
MaleculeH₂(F₂Os)
Evidence
119:70… odo/tasks.json
120fn data_file() -> PathBuf {
121 if let Ok(path) = env::var("TODO_FILE") {
122 return PathBuf::from(path);
123 }
124 let dir = env::var("TODO_DIR").map(PathBuf::from).unwrap_or_else(|_ …
136:23… ,
137 tasks: Vec::new(),
138 };
139 }
140 let raw = fs::read_to_string(path).unwrap_or_else(|e| {
141 eprintln!("错误:无法读取数据文件 {}({})", path.display(), e);
142 process …
160:23… on::to_string_pretty(data).expect("序列化不应失败");
161 fs::write(path, raw).unwrap_or_else(|e| {
162 eprintln!("错误:无法写入数据文件 {}({})", path.display(), e);
163 pr …
No evidence locations were recorded for this file. Raw result