-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For updr I made fewer things public and then didn't document the private items (I don't understand the code well enough to add that documentation in any case). Signed-off-by: Tej Chajed <[email protected]>
- Loading branch information
Showing
6 changed files
with
35 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
// Copyright 2022-2023 VMware, Inc. | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
|
||
//! Aliases for HashMap and HashSet with deterministic iteration order. | ||
use fxhash::FxBuildHasher; | ||
use std::hash::Hash; | ||
|
||
/// HashMap with deterministic iteration order | ||
pub type HashMap<K, V> = indexmap::IndexMap<K, V, FxBuildHasher>; | ||
/// HashSet with deterministic iteration order | ||
pub type HashSet<K> = indexmap::IndexSet<K, FxBuildHasher>; | ||
|
||
// pub type HashMap<K, V> = std::collections::HashMap<K, V>; | ||
// pub type HashSet<K> = std::collections::HashSet<K>; | ||
|
||
/// Construct a deterministic HashSet from a `std::collections::HashSet`. | ||
pub fn set_from_std<K: Eq + Hash>(s: std::collections::HashSet<K>) -> HashSet<K> { | ||
s.into_iter().collect() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters