feat: add Json::into_inner()#4123
Conversation
|
7 timed-out jobs in CI, 1 failed due to 2025-12-11T14:26:27.8248011Z --2025-12-11 14:26:27-- https://github.com/nalgeon/sqlean/releases/download/0.15.2/ipaddr.so
2025-12-11T14:26:27.8494057Z Resolving github.com (github.com)... 140.82.112.3
2025-12-11T14:26:27.8547619Z Connecting to github.com (github.com)|140.82.112.3|:443... connected.
2025-12-11T14:26:29.8759347Z HTTP request sent, awaiting response... 503 Service Unavailable
2025-12-11T14:26:29.8862495Z 2025-12-11 14:26:29 ERROR 503: Service Unavailable.some Microsoft engineering going on, hold on for a sec, will trigger CI via reopening PR |
|
well, now CI passes, but 2 jobs running on MacOS 13 fail, since
besides that, this PR is ready to be reviewed. deleting |
|
Why are you constantly closing and reopening this? I'll get to it when I can. |
|
|
You can do the same thing by pushing an empty commit, or amending the existing one to update the timestamp+sha. |
Json::into_inner()
|
thx m8 |
Does your PR solve an issue?
No, but i can create one if bureaucracy is expected.
Is this a breaking change?
No. Adding a new method for already existing type is not considered a breaking change for downstream-users.
ThIs PR introduces
.into_innermethod forJson<T>type, so that users can extractTfromJson<T>, if they prefer to do so. Regarding sqlx-core types, there's already.into_innermethod in Text type, but there is none in Json type. Using.into_innermight come really handy, especially when iterating and doing.map(Json::into_inner)instead of.map(|Json(x)| x).Tests
Regarding tests and Text type, its
.into_innermethod is not found in examples / whatnot. Which is why there are no tests written -- I expected that if another type.into_inner's method does not appear in tests / examples, similar the situation should be for my change. If I'm wrong -- never hesitate to announce that :)