|
@ -2,9 +2,9 @@ use crate::parser::{parser, Value}; |
|
|
|
|
|
|
|
|
fn json_convert(content: &str) -> Result<String, String> { // convert to JSON format
|
|
|
fn json_convert(content: &str) -> Result<String, String> { // convert to JSON format
|
|
|
let data = match parser(content)? { |
|
|
let data = match parser(content)? { |
|
|
Value::JSON(_json) => serde_json::to_string(&_json), |
|
|
Value::JSON(json) => serde_json::to_string(&json), |
|
|
Value::YAML(_yaml) => serde_json::to_string(&_yaml), |
|
|
Value::YAML(yaml) => serde_json::to_string(&yaml), |
|
|
Value::TOML(_toml) => serde_json::to_string(&_toml), |
|
|
Value::TOML(toml) => serde_json::to_string(&toml), |
|
|
}; |
|
|
}; |
|
|
match data { |
|
|
match data { |
|
|
Ok(data) => Ok(data), |
|
|
Ok(data) => Ok(data), |
|
|