Skip to content

Commit 29bb259

Browse files
JakobDegenfacebook-github-bot
authored andcommitted
third party: Upgrade rustc_hash
Summary: To 2.1 Unfortunately, I can't remove the old version of the crate. The problem is that it appears in the [public API](https://docs.rs/tiktoken-rs/latest/tiktoken_rs/struct.CoreBPE.html#method.new) of `tiktoken_rs`, which we also import. That crate has a PR to upgrade its dependency [here](zurawiki/tiktoken-rs#95) but that has not been merged. Alternatives here are: 1. Fork `tiktoken_rs`. This seems worse. 2. It's strictly speaking possible to use generics combined with some other tricks to avoid needing to name v1 of `FxHashMap` in fbsource. However, that makes that code extraordinarily hard to change and work with, and doesn't seem all that clearly motivated. If there's something else I should be doing here, all ears Reviewed By: zertosh Differential Revision: D68064854 fbshipit-source-id: bd1c96abbc0ebaa178a55826bc85c61eb35e8301
1 parent de68be9 commit 29bb259

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

eden/mononoke/git/packfile/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mononoke_types = { version = "0.1.0", path = "../../mononoke_types" }
2626
packfile_thrift = { version = "0.1.0", path = "if" }
2727
pin-project = "0.4.30"
2828
quickcheck = "1.0"
29-
rustc-hash = "1.1.0"
29+
rustc-hash = "2.1.0"
3030
sha1 = "0.10.5"
3131
thiserror = "2"
3232
tokio = { version = "1.41.0", features = ["full", "test-util", "tracing"] }

eden/mononoke/git/packfile/src/pack.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77

88
use std::collections::HashMap;
9-
use std::hash::BuildHasherDefault;
109
use std::io::Write;
1110

1211
use anyhow::Context;
@@ -17,8 +16,8 @@ use gix_hash::ObjectId;
1716
use gix_pack::data::header;
1817
use gix_pack::data::output::Entry;
1918
use gix_pack::data::Version;
19+
use rustc_hash::FxBuildHasher;
2020
use rustc_hash::FxHashMap;
21-
use rustc_hash::FxHasher;
2221
use thiserror::Error;
2322
use tokio::io::AsyncWrite;
2423
use tokio::io::AsyncWriteExt;
@@ -85,10 +84,7 @@ impl<T: AsyncWrite + Unpin> PackfileWriter<T> {
8584
// Git uses V2 right now so we do the same
8685
header_info: Some((Version::V2, count)),
8786
object_offset_with_validity: Vec::with_capacity(count as usize),
88-
object_id_with_index: HashMap::with_capacity_and_hasher(
89-
count as usize,
90-
BuildHasherDefault::<FxHasher>::default(),
91-
),
87+
object_id_with_index: HashMap::with_capacity_and_hasher(count as usize, FxBuildHasher),
9288
delta_form,
9389
}
9490
}

eden/mononoke/git/protocol/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ packfile = { version = "0.1.0", path = "../packfile" }
3838
repo_blobstore = { version = "0.1.0", path = "../../blobrepo/repo_blobstore" }
3939
repo_derived_data = { version = "0.1.0", path = "../../repo_attributes/repo_derived_data" }
4040
repo_identity = { version = "0.1.0", path = "../../repo_attributes/repo_identity" }
41-
rustc-hash = "1.1.0"
41+
rustc-hash = "2.1.0"
4242
scuba_ext = { version = "0.1.0", path = "../../common/scuba_ext" }
4343
tempfile = "3.8"
4444
tokio = { version = "1.41.0", features = ["full", "test-util", "tracing"] }

eden/mononoke/git_server/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ repo_authorization = { version = "0.1.0", path = "../repo_authorization" }
5656
repo_blobstore = { version = "0.1.0", path = "../blobrepo/repo_blobstore" }
5757
repo_identity = { version = "0.1.0", path = "../repo_attributes/repo_identity" }
5858
repo_permission_checker = { version = "0.1.0", path = "../repo_attributes/repo_permission_checker" }
59-
rustc-hash = "1.1.0"
59+
rustc-hash = "2.1.0"
6060
sapling-clientinfo = { version = "0.1.0", path = "../../scm/lib/clientinfo" }
6161
scuba_ext = { version = "0.1.0", path = "../common/scuba_ext" }
6262
secure_utils = { version = "0.1.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "main" }

0 commit comments

Comments
 (0)