Skip to content

State that pop for length 1 is an example #360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/vec/vec-push-pop.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ interprets it as a value of type T. This will leave the memory at this address
logically uninitialized, even though there is in fact a perfectly good instance
of T there.

For `pop`, if the old len is 1, we want to read out of the 0th index. So we
should offset by the new len.
For `pop`, if the old len is 1, for example, we want to read out of the 0th
index. So we should offset by the new len.

<!-- ignore: simplified code -->
```rust,ignore
Expand Down