[−][src]Function dumplingh::ops::save_to_file
pub fn save_to_file<P: AsRef<Path>, S: Serialize>(
out_p: P,
val: &S,
compact: bool,
what: &'static str
) -> Result<(), Error>
Save the specified data to the specified file, serialised as JSON.
Convenience function for wrapping save_data(File::create())
.
Examples
assert_eq!(save_to_file(&issues_file, &issues, false, "issues"), Ok(()));