mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-23 21:05:08 +00:00
This adds a collection that has a map-like API but is backed by vectors. For small collections, this often outperforms a HashMap because you don't have the overhead of hashing things and everything is guaranteed to be contiguous in memory. I hand-rolled one of these in `ProjectGroupBuilder` but this factors it into its own collection. This implements the API that `ProjectGroupBuilder` needed, but if this becomes more widely used we can expand to include more of the `HashMap` API. Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A
21 lines
353 B
TOML
21 lines
353 B
TOML
[package]
|
|
name = "collections"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
publish = false
|
|
license = "Apache-2.0"
|
|
description = "Standard collection types used by Zed and GPUI"
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
path = "src/collections.rs"
|
|
doctest = false
|
|
|
|
[features]
|
|
test-support = []
|
|
|
|
[dependencies]
|
|
indexmap.workspace = true
|
|
rustc-hash.workspace = true
|