mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:44:56 +00:00

Regardless of whether #16408 and #16311 pan out, this part is worth pulling out as a separate PR. Before, you had to define a new `IndexVec` index type for each type of association list you wanted to create. Now there's a single index type that's internal to the alist implementation, and you use `List<K, V>` to store a handle to a particular list. This also adds some property tests for the alist implementation.
13 lines
351 B
Rust
13 lines
351 B
Rust
//! Provides new-type wrappers for collections that are indexed by a [`Idx`] rather
|
|
//! than `usize`.
|
|
//!
|
|
//! Inspired by [rustc_index](https://github.com/rust-lang/rust/blob/master/compiler/rustc_index/src/lib.rs).
|
|
|
|
mod idx;
|
|
mod slice;
|
|
mod vec;
|
|
|
|
pub use idx::Idx;
|
|
pub use ruff_macros::newtype_index;
|
|
pub use slice::IndexSlice;
|
|
pub use vec::IndexVec;
|