Skip to content

Fix inconsistent duplicate handling across construction paths - #77

Open
extremeandy wants to merge 1 commit into
martinohmann:mainfrom
extremeandy:fix/duplicate-handling-66
Open

Fix inconsistent duplicate handling across construction paths#77
extremeandy wants to merge 1 commit into
martinohmann:mainfrom
extremeandy:fix/duplicate-handling-66

Conversation

@extremeandy

@extremeandy extremeandy commented Aug 10, 2026

Copy link
Copy Markdown

Summary

  • Align duplicate resolution across all population paths (From<Vec>, collect, extend, insert, slice/array) for VecMap, KeyedVecSet, and VecSet (fixes VecMap::from(Vec) and VecSet::from(Vec) keep different duplicates than from_iter / from([..]) #66).
  • Add dedup_keep_first and dedup_keep_last_value helpers: maps/keyed sets keep the first key position with the last value; sets keep the first equal element and ignore later duplicates.
  • Fix VecSet::insert, extend, and append, which previously used map-style replacement instead of set semantics.

Closes #66.

Make From<Vec>, collect, extend, and insert agree on duplicate resolution
for VecMap, KeyedVecSet, and VecSet.

Fixes martinohmann#66
@extremeandy
extremeandy force-pushed the fix/duplicate-handling-66 branch from 37f2207 to 7d73200 Compare August 10, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VecMap::from(Vec) and VecSet::from(Vec) keep different duplicates than from_iter / from([..])

1 participant