mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-22 14:35:36 +01:00
fix codegen (truncate files)
This commit is contained in:
parent
976100e3ec
commit
eeb06337ee
1 changed files with 8 additions and 1 deletions
|
@ -79,7 +79,14 @@ pub fn ensure_files_contents<'a>(
|
|||
let mut err_count = 0;
|
||||
|
||||
for (path, contents) in files_and_contents {
|
||||
let mut file = fs::File::options().read(true).write(true).create(true).open(path).unwrap();
|
||||
let mut file = fs::File::options()
|
||||
.read(true)
|
||||
.write(true)
|
||||
.create(true)
|
||||
.truncate(true)
|
||||
.append(false)
|
||||
.open(path)
|
||||
.unwrap();
|
||||
let mut old_contents = String::with_capacity(contents.len());
|
||||
file.read_to_string(&mut old_contents).unwrap();
|
||||
|
||||
|
|
Loading…
Reference in a new issue