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

add partialeq to RawValue #1227

Closed
wants to merge 1 commit into from
Closed

add partialeq to RawValue #1227

wants to merge 1 commit into from

Conversation

rydb
Copy link

@rydb rydb commented Jan 13, 2025

RawValue does not currently implement PartialEq, which is a blocker for:
gltf-rs/gltf#442

This pr fixes implements PartialEq for RawValue to fix that.

@rydb rydb changed the title added partialeq to RawValue add partialeq to RawValue Jan 14, 2025
Copy link
Member

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

I think I would prefer not to add the impl. People are going to find it unexpected that the equal JSON values [ null ] and [null] would be considered unequal by RawValue.

The underlying JSON bytes are publicly exposed though, so any downstream code can use raw_a.get() == raw_b.get() without this impl when this is the behavior they want.

@dtolnay dtolnay closed this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants