scatter_net/legacy/net/config/methods/
to_file.rs

1use std::{fs::File, io::Write, path::Path};
2
3use crate::NetConfig;
4
5impl NetConfig {
6    pub fn to_file<P>(&self, path: P) -> std::io::Result<()>
7    where
8        P: AsRef<Path>,
9    {
10        File::create(path)?.write_all(self.to_string().as_bytes())
11    }
12}