mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-27 11:02:33 +01:00
c31063a050
## Summary
Remove verbose syntax pattern by adopting `trim_{prefix,suffix}`, which
sometimes saves clones or other work.
`value.strip_suffix(pattern).unwrap(value)` ->
`value.trim_suffix(pattern)`
`value.strip_prefix(pattern).unwrap(value)` ->
`value.trim_prefix(pattern)`
I also found a common pattern of `.starts_with` before `strip_prefix`,
which the latter already checks for implicitly.
## Testing
Tests pass, no behavior changes.
## Self-review
- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.
Release Notes:
- N/A
- [GPUI] N/A