Skip to content

Add Facet support for indexmap::IndexSet#2467

Open
TeamDman wants to merge 1 commit into
facet-rs:mainfrom
TeamDman:pr/indexset-support
Open

Add Facet support for indexmap::IndexSet#2467
TeamDman wants to merge 1 commit into
facet-rs:mainfrom
TeamDman:pr/indexset-support

Conversation

@TeamDman

@TeamDman TeamDman commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #2466

This adds Facet support for indexmap::IndexSet<T, S> under Facet's existing indexmap feature.

What changed:

  • added a Facet impl for IndexSet<T, S> in the indexmap integration
  • modeled IndexSet as a set
  • added unit coverage for insertion, duplicate handling, iteration order, and deallocation behavior
  • added format-suite coverage so JSON, TOML, YAML, MsgPack, Lua, and ASN.1 inherit round-trip testing

Before:

use facet::Facet;
use indexmap::IndexSet;

#[derive(Facet)]
struct Wrapper {
    values: IndexSet<String>,
}

This failed with:

error[E0277]: the trait bound `IndexSet<String>: Facet<'_>` is not satisfied

After:

  • IndexSet derives/fields compile under the indexmap feature
  • set semantics are preserved
  • insertion-order iteration is preserved

Validation:

cargo test -p facet-core indexset --features indexmap
cargo test -p facet-json --test format_suite
cargo test -p facet-msgpack --test format_suite
cargo check -p facet-yaml --test format_suite -p facet-toml --test format_suite -p facet-lua --test format_suite -p facet-asn1 --test format_suite

Drafted with LLM assistance using Codex (GPT-5).

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.97802% with 51 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
facet-core/src/impls/crates/indexmap.rs 69.87% 50 Missing ⚠️
facet-format-suite/src/lib.rs 93.75% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

Add IndexSet support under Facet's existing indexmap feature

1 participant