remove!: World::save function
This commit is contained in:
@@ -90,24 +90,4 @@ impl World {
|
||||
|
||||
Ok(world)
|
||||
}
|
||||
|
||||
pub fn save(&self, world_path: Option<PathBuf>, do_print: bool) -> Result<()> {
|
||||
let text = toml::to_string_pretty(self)?;
|
||||
|
||||
if let Some(world_path) = world_path {
|
||||
let mut file = OpenOptions::new()
|
||||
.write(true)
|
||||
.create(true)
|
||||
.truncate(true)
|
||||
.open(world_path)?;
|
||||
|
||||
file.write_all(text.as_bytes())?;
|
||||
}
|
||||
|
||||
if do_print {
|
||||
println!("{}", text);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user