-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Initialize vector before calling
.set_len()
The previous use of `.set_len()` did not uphold the safety contract, resulting in undefined behavior. [0, 1] Initializing the spare capacity before setting the length makes the behavior defined. [0] https://users.rust-lang.org/t/58755 [1] https://users.rust-lang.org/t/38248
- Loading branch information
1 parent
d5ef951
commit 3727f02
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters