Replace panicking unwraps in iterator and Option chains (#61277)
# Objective
Remove `.unwrap()` calls in iterator/`Option` chains that could panic at
runtime.
## Solution
Use `and_then`/`filter_map` with `.ok()` for fallible downcasts
(`entry_view_state.rs`) and keystroke parsing (`vim/command.rs`); use a
descriptive `expect` in `suggest_autoindents` where the invariant is
intentional (`buffer.rs`).
## Testing
- `cargo test -p language buffer` (69 passed)
- `cargo test -p vim command` (26 passed)
- `cargo test -p agent_ui entry_view` (3 passed)
## Self-Review Checklist:
- [x] I have reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable
Release Notes:
- N/A
4605a0f8dcMiguel Raz Guzmán Macedo committed on 7/23/2026, 7:54:43 AM· committed by GitHubparentd87dfaa