Skip to content

Custom Debug impl for Map types#66

Open
aDotInTheVoid wants to merge 1 commit intoorlp:masterfrom
aDotInTheVoid:debug
Open

Custom Debug impl for Map types#66
aDotInTheVoid wants to merge 1 commit intoorlp:masterfrom
aDotInTheVoid:debug

Conversation

@aDotInTheVoid
Copy link

Before:

[examples/debug.rs:10] &x = SlotMap {
    slots: [
        Slot {
            version: 0,
            next_free: 0,
        },
        Slot {
            version: 1,
            value: "a",
        },
        Slot {
            version: 1,
            value: "b",
        },
        Slot {
            version: 1,
            value: "c",
        },
    ],
    free_head: 4,
    num_elems: 3,
    _k: PhantomData,
}
[examples/debug.rs:16] x = SlotMap {
    slots: [
        Slot {
            version: 0,
            next_free: 0,
        },
        Slot {
            version: 3,
            value: "later",
        },
        Slot {
            version: 1,
            value: "b",
        },
        Slot {
            version: 1,
            value: "c",
        },
    ],
    free_head: 4,
    num_elems: 3,
    _k: PhantomData,
}

After:

[examples/debug.rs:10] &x = {
    CustomKey(
        1v1,
    ): "a",
    CustomKey(
        2v1,
    ): "b",
    CustomKey(
        3v1,
    ): "c",
}
[examples/debug.rs:16] x = {
    CustomKey(
        1v3,
    ): "later",
    CustomKey(
        2v1,
    ): "b",
    CustomKey(
        3v1,
    ): "c",
}

Fixes #65

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.

Better debug output

1 participant