remove unneeded unsafe blocks

This commit is contained in:
Nikolay Kim 2021-02-20 10:39:29 +06:00
parent 4225e093cc
commit 40b0d5e4ab
2 changed files with 7 additions and 10 deletions

View file

@ -263,8 +263,7 @@ where
// remove written data
if written == len {
// flushed same amount as in buffer, we dont need to reallocate
unsafe { self.write_buf.set_len(0) }
self.write_buf.clear()
} else {
self.write_buf.advance(written);
}