# std: deprecate ensureCapacity, add two other capacity functions · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/c8ae581fef6506a8234cdba1355ba7f0f449031a)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: c8ae581fef6506a8234cdba1355ba7f0f449031a

Requested commit: c8ae581fef6506a8234cdba1355ba7f0f449031a

Commit: c8ae581fef6506a8234cdba1355ba7f0f449031a

Tree: 19b5e68b63e296e73bfd17032c5a46352eae38fc

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std: deprecate ensureCapacity, add two other capacity functions

I've run into this footgun enough times, nearly every time I want
`ensureUnusedCapacity`, not `ensureCapacity`. This commit deprecates
`ensureCapacity` in favor of `ensureTotalCapacity` and introduces
`ensureUnusedCapacity`.

```

## Parents

- [5ff45b3f44e7f1272b655b366cee4089d0aa8509](https://git.cafe/gitcafe/zig/commit/5ff45b3f44e7f1272b655b366cee4089d0aa8509?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/c8ae581fef6506a8234cdba1355ba7f0f449031a?format=markdown)
