mirror of
				https://github.com/pcvolkmer/osc-variant.git
				synced 2025-10-31 00:16:11 +00:00 
			
		
		
		
	Do not create temp value
This commit is contained in:
		| @@ -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(()) | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user