Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: indexmap-rs/indexmap
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.2.1
Choose a base ref
...
head repository: indexmap-rs/indexmap
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.2.2
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Jan 30, 2024

  1. Add indexing methods to raw entry

    The `std`-matching methods of `RawEntryBuilder` only return `(&K, &V)`,
    but the index is also useful when working with `IndexMap`.
    
    ```rust
    impl<'a, K, V, S> RawEntryBuilder<'a, K, V, S> {
        /// Access an entry by hash, including its index.
        pub fn from_hash_full<F>(self, hash: u64, is_match: F) -> Option<(usize, &'a K, &'a V)>
        where
            F: FnMut(&K) -> bool,
    
        /// Access the index of an entry by hash.
        pub fn index_from_hash<F>(self, hash: u64, is_match: F) -> Option<usize>
        where
            F: FnMut(&K) -> bool,
    }
    ```
    
    In addition, the `RawEntryMut` enum can report its index by forwarding
    to the existing methods on its variants.
    
    ```rust
    impl<'a, K, V, S> RawEntryMut<'a, K, V, S> {
        /// Return the index where the key-value pair exists or may be inserted.
        pub fn index(&self) -> usize
    }
    ```
    cuviper committed Jan 30, 2024
    Configuration menu
    Copy the full SHA
    54a42ec View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2024

  1. Release 2.2.2

    cuviper committed Jan 31, 2024
    Configuration menu
    Copy the full SHA
    f4bb006 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #305 from cuviper/raw_entry-index

    Add indexing methods to raw entry
    cuviper authored Jan 31, 2024
    Configuration menu
    Copy the full SHA
    1a50e7b View commit details
    Browse the repository at this point in the history
Loading