# project: Use \`checked_sub\` for next/previous in search history \(\#34408\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/bd78f2c49324169a9938628a339114ee143eabce)

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

Visibility: public

Requested revision: bd78f2c49324169a9938628a339114ee143eabce

Requested commit: bd78f2c49324169a9938628a339114ee143eabce

Commit: bd78f2c49324169a9938628a339114ee143eabce

Tree: 48a4cf28090bbd8aedb89a8cc5156e2ce98cdc67

Author: tidely

Committer: GitHub

## Message

```
project: Use `checked_sub` for next/previous in search history (#34408)

Use `checked_sub` instead of checking for bounds manually. Also greatly
simplifies the logic for `next` and `previous`. Removing other manual
bounds checks as well

Release Notes:

- N/A
```

## Parents

- [d1abba0d336b18de77906c1e95180c4c88170faa](https://git.cafe/gitcafe/zed/commit/d1abba0d336b18de77906c1e95180c4c88170faa?format=markdown)

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