| 60 | // Transforms a json value to string |
| 61 | #[allow(dead_code)] |
| 62 | fn value_to_string(value: &Value) -> Result<String, IntTestError> { |
| 63 | match value { |
| 64 | Value::Bool(bool) => match bool { |
| 65 | true => Ok("true".to_string()), |
| 66 | false => Ok("false".to_string()), |
| 67 | }, |
| 68 | Value::Number(n) => Ok(n.to_string()), |
| 69 | Value::String(s) => Ok(s.to_string()), |
| 70 | _ => Err(IntTestError::JsonData( |
| 71 | "Value parsing not implemented for this type".to_string(), |
| 72 | )), |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | // Helper Function |
| 77 | // Extracts value from a given json object and key |