Skip to content

Commit

Permalink
Remove dead method on json::Value.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcamiel committed Jan 21, 2025
1 parent 2472aa9 commit 0cf921d
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions packages/hurl_core/src/ast/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,20 @@ use core::fmt;
use crate::ast::core::Template;
use crate::ast::{Placeholder, TemplateElement};

/// This the AST for the JSON used within Hurl (for instance in [implicit JSON body request](https://hurl.dev/docs/request.html#json-body)).
///
/// This the AST for the JSON used within Hurl
/// # Example
///
/// It is a superset of the standard json spec.
/// Strings have been replaced by Hurl template.
/// ```hurl
/// POST https://example.org/api/cats
/// {
/// "id": 42,
/// "lives": {{lives_count}},
/// "name": "{{name}}"
/// }
/// ```
///
/// It is a superset of the standard JSON spec. Strings have been replaced by Hurl [`Placeholder`].
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Value {
Placeholder(Placeholder),
Expand All @@ -43,20 +51,6 @@ pub enum Value {
Null,
}

impl Value {
pub fn _type(&self) -> String {
match self {
Value::Number(_) => "number".to_string(),
Value::Null => "null".to_string(),
Value::Boolean(_) => "boolean".to_string(),
Value::List { .. } => "list".to_string(),
Value::Object { .. } => "object".to_string(),
Value::String(_) => "string".to_string(),
Value::Placeholder(_) => "placeholder".to_string(),
}
}
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ListElement {
pub space0: String,
Expand Down

0 comments on commit 0cf921d

Please sign in to comment.