Skip to content

Feedback: The relationship between push_back and insert/insert_full is a bit confusing #10

@bgw

Description

@bgw

insert_full and push_back have identical implementations and near-identical descriptions.

https://github.com/indexmap-rs/ringmap/blob/main/src/map.rs#L405-L437

This was a bit confusing to me. I'm guessing the insert-style API is there for compatibility with indexmap and hashmap's APIs, but the push_back API makes more sense for a VecDeque.

I feel like you should pick one style of API and deprecate the other? At the least, the documentation should explain that they do the same thing.

I'm personally trying out this library because of the VecDeque-style aspects of it, so I'd prefer the push_back API.

Thanks for this library, and of course indexmap. We use indexmap pretty heavily in Turbopack because we need predictable iteration order for our caching layer to work effectively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions