Skip to content

Commit 93bafbe

Browse files
authored
feat: add self-extractor for JSON type (#4123)
1 parent 452da1a commit 93bafbe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sqlx-core/src/types/json.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ use crate::types::Type;
8686
#[serde(transparent)]
8787
pub struct Json<T: ?Sized>(pub T);
8888

89+
impl<T> Json<T> {
90+
/// Extract the inner value.
91+
pub fn into_inner(self) -> T {
92+
self.0
93+
}
94+
}
95+
8996
impl<T> From<T> for Json<T> {
9097
fn from(value: T) -> Self {
9198
Self(value)

0 commit comments

Comments
 (0)