mirror of
https://github.com/pcvolkmer/osc-variant.git
synced 2025-04-19 19:56:50 +00:00
Do not create temp value
This commit is contained in:
parent
1fdac88d6d
commit
2c11690edf
@ -85,14 +85,14 @@ fn read_inputfile(inputfile: String) -> Result<OnkostarEditor, FileError> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn write_outputfile(filename: String, content: &String) -> Result<(), FileError> {
|
fn write_outputfile(filename: String, content: &String) -> Result<(), FileError> {
|
||||||
let mut file = OpenOptions::new()
|
OpenOptions::new()
|
||||||
.read(false)
|
.read(false)
|
||||||
.write(true)
|
.write(true)
|
||||||
.create(true)
|
.create(true)
|
||||||
.truncate(true)
|
.truncate(true)
|
||||||
.open(filename.clone())
|
.open(filename.clone())
|
||||||
.map_err(|err| FileError::Writing(filename.clone(), err.to_string()))?;
|
.map_err(|err| FileError::Writing(filename.clone(), err.to_string()))?
|
||||||
file.write_all(content.as_bytes())
|
.write_all(content.as_bytes())
|
||||||
.map_err(|err| FileError::Writing(filename, err.to_string()))?;
|
.map_err(|err| FileError::Writing(filename, err.to_string()))?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user