Skip to content

Commit 7c7132d

Browse files
committed
Use BTreeMap to make crates.io sync order deterministic
1 parent d6ea153 commit 7c7132d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sync-team/src/crates_io/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::cmp::Ordering;
66
use crate::crates_io::api::{CratesIoApi, TrustedPublishingGitHubConfig};
77
use anyhow::Context;
88
use secrecy::SecretString;
9-
use std::collections::HashMap;
9+
use std::collections::BTreeMap;
1010
use std::fmt::{Display, Formatter};
1111

1212
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
@@ -30,7 +30,7 @@ struct CrateConfig {
3030

3131
pub(crate) struct SyncCratesIo {
3232
crates_io_api: CratesIoApi,
33-
crates: HashMap<CrateName, CrateConfig>,
33+
crates: BTreeMap<CrateName, CrateConfig>,
3434
}
3535

3636
impl SyncCratesIo {
@@ -40,7 +40,7 @@ impl SyncCratesIo {
4040
dry_run: bool,
4141
) -> anyhow::Result<Self> {
4242
let crates_io_api = CratesIoApi::new(token, dry_run);
43-
let crates: HashMap<CrateName, CrateConfig> = team_api
43+
let crates: BTreeMap<CrateName, CrateConfig> = team_api
4444
.get_repos()?
4545
.into_iter()
4646
.flat_map(|repo| {

0 commit comments

Comments
 (0)