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
This commit is contained in:
tidely 2025-07-15 17:42:37 +03:00 committed by GitHub
parent d1abba0d33
commit bd78f2c493
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 25 deletions

View file

@ -169,7 +169,7 @@ impl Project {
.read(cx)
.get_cli_environment()
.unwrap_or_default();
env.extend(settings.env.clone());
env.extend(settings.env);
match self.ssh_details(cx) {
Some(SshDetails {
@ -247,7 +247,7 @@ impl Project {
.unwrap_or_default();
// Then extend it with the explicit env variables from the settings, so they take
// precedence.
env.extend(settings.env.clone());
env.extend(settings.env);
let local_path = if is_ssh_terminal { None } else { path.clone() };