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 From impls for Json #2224

Merged
merged 2 commits into from
Mar 10, 2023
Merged

Conversation

dbeckwith
Copy link
Contributor

Implements conversion traits between Json and its inner value. Useful for generic code. I ran into this today while trying to return an impl Into<Foo> using sqlx::types::Json.

@dbeckwith
Copy link
Contributor Author

Hmm I didn't realize that impl<T> From<Json<T>> for T violates some orphan rule. I tried impl<T> Into<T> for Json<T> but that conflicts with the blanket impl. Guess I can't actually get the impl I wanted, but the other one could still be useful.

@dbeckwith
Copy link
Contributor Author

Latest failures seem unrelated to my changes.

@abonander abonander force-pushed the main branch 2 times, most recently from 6cf15b0 to eade49c Compare February 21, 2023 22:56
@abonander
Copy link
Collaborator

@dbeckwith if you rebase it should fix the failures.

@dbeckwith dbeckwith force-pushed the dbeckwith.json-impl-from branch from 984d7fd to 1706fe9 Compare March 10, 2023 02:45
@abonander abonander merged commit cea7228 into launchbadge:main Mar 10, 2023
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.

2 participants