diff options
| author | tv <tv@krebsco.de> | 2026-11-02 10:35:38 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-02 10:35:38 +0100 |
| commit | 55d33b0f0bc3aa4497842355684da2efa51a6011 (patch) | |
| tree | 8ec904b40f95f44bed71a60641b497b41adbb6a1 /src/document/typed.rs | |
| parent | 58d574166fef1246f367009546358703e16d7f7e (diff) | |
api: types are sticky
Diffstat (limited to 'src/document/typed.rs')
| -rw-r--r-- | src/document/typed.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/document/typed.rs b/src/document/typed.rs index a542578..cf7f49b 100644 --- a/src/document/typed.rs +++ b/src/document/typed.rs @@ -519,25 +519,4 @@ impl Val { Val::Scalar(scalar) => Kind::of(scalar), } } - - /// In JSON of `form`. - pub(crate) fn to_json(&self, form: JsonForm) -> Option<JsonValue> { - Some(match self { - Val::Map(entries) => map_to_json( - entries - .iter() - .map(|(key, value)| Some((key.clone(), value.to_json(form)?))) - .collect::<Option<_>>()?, - form, - ), - Val::List(items) => JsonValue::Array( - items - .iter() - .map(|item| item.to_json(form)) - .collect::<Option<_>>()?, - ), - Val::Text(text) => text_to_json(text.clone(), form), - Val::Scalar(scalar) => scalar_to_json(scalar, form)?, - }) - } } |
