Skip to content

Glossary: Rust Basics

push / pop

Also written: push_str, push(), pop()

`push` adds an item to the end of a `Vec`, `pop` removes the last item and returns it as an `Option`, and `push_str` adds text to the end of a `String`. The variable must be `mut`.

Where the book teaches it

Related terms

VecStringOption