Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(turbopack): Update indexmap dependency from 1.x to 2.x #72429

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 48 additions & 48 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ futures-retry = "0.6.0"
hashbrown = "0.14.5"
httpmock = { version = "0.6.8", default-features = false }
image = { version = "0.25.0", default-features = false }
indexmap = "1.9.2"
indexmap = "2.5.0"
indicatif = "0.17.3"
indoc = "2.0.0"
itertools = "0.10.5"
Expand Down
2 changes: 1 addition & 1 deletion crates/next-api/src/versioned_content_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl VersionedContentMap {
.get_mut(k)
// guaranteed
.unwrap()
.remove(&assets);
.swap_remove(&assets);
changed = changed || res
}
changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub(super) async fn update_chunk_list(
let mut chunks = FxIndexMap::<_, _>::default();

for (chunk_path, from_chunk_version) in &from.by_path {
if let Some(chunk_content) = by_path.remove(chunk_path) {
if let Some(chunk_content) = by_path.swap_remove(chunk_path) {
let chunk_update = chunk_content
.update(TraitRef::cell(from_chunk_version.clone()))
.await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ pub(super) async fn update_ecmascript_merged_chunk(
};

let chunk_update = if let Some(from_version) =
from_versions_by_chunk_path.remove(chunk_path)
from_versions_by_chunk_path.swap_remove(chunk_path)
{
// The chunk was present in the previous version, so we must update it.
let update = update_ecmascript_chunk(*content, from_version).await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl RouteTree {
self.not_found_sources
.extend(other.not_found_sources.iter().copied());
for (key, value) in other.static_segments.iter() {
if let Some((key, self_value)) = self.static_segments.remove_entry(key) {
if let Some((key, self_value)) = self.static_segments.swap_remove_entry(key) {
static_segments.insert(key, vec![self_value, *value]);
} else if let Some(list) = static_segments.get_mut(key) {
list.push(*value);
Expand Down
8 changes: 4 additions & 4 deletions turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ impl DepGraph {
let data = data.get(id).unwrap();

for var in data.var_decls.iter() {
required_vars.remove(var);
required_vars.swap_remove(var);
}

// Depend on import statements from 'ImportBinding'
Expand Down Expand Up @@ -462,7 +462,7 @@ impl DepGraph {
is_type_only: false,
});

required_vars.remove(export);
required_vars.swap_remove(export);

deps.push(PartId::Export(export.0.as_str().into()));

Expand Down Expand Up @@ -944,7 +944,7 @@ impl DepGraph {
&top_level_vars,
)
};
used_ids.read.remove(&default_var.to_id());
used_ids.read.swap_remove(&default_var.to_id());
used_ids.write.insert(default_var.to_id());
let mut captured_ids = if export.decl.is_fn_expr() {
ids_captured_by(
Expand All @@ -956,7 +956,7 @@ impl DepGraph {
} else {
Vars::default()
};
captured_ids.read.remove(&default_var.to_id());
captured_ids.read.swap_remove(&default_var.to_id());

let data = ItemData {
read_vars: used_ids.read,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@ impl TurbopackFormat {
};
let mut values = values.into_iter().collect::<FxIndexMap<_, _>>();
let duration = values
.remove("duration")
.swap_remove("duration")
.and_then(|v| v.as_u64())
.unwrap_or(0);
let name = values
.remove("name")
.swap_remove("name")
.and_then(|v| v.as_str().map(|s| s.to_string()))
.unwrap_or("event".into());

Expand Down
Loading