Expand description
json相关工具
§示例
use serde_json::json;
use wang_utils_json::write_json_to_file;
#[test]
fn test_write_json_to_file() -> anyhow::Result<()> {
let json = json!({
"user":"123312",
"pwd":"user-pwd"
});
write_json_to_file("test.json", &json)?;
Ok(())
}
Functions§
- write_
json_ to_ file - 转json后写入文件
- write_
pretty_ json_ to_ file - 转json后写入文件,与write_json_to_file的区别是对json进行了格式化