Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{Cast, Value};

impl From<Value> for serde_json::value::Value {
	fn from(value: Value) -> serde_json::value::Value {
		match value {
			Value::Bool(value) => value.into(),
			Value::U64(value) => value.into(),
			Value::I64(value) => value.into(),
			Value::F64(value) => value.into(),
			Value::Str(value) => value.into(),
			Value::Null => serde_json::value::Value::Null,
			other => {
				let string: String = other.cast().unwrap();
				string.into()
			}
		}
	}
}