Trim text before json parsing (#1955)
This commit is contained in:
parent
ccc16fa9a7
commit
bb94374c78
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ pub fn value(input: &str) -> Result<Value, Error> {
|
|||
/// Parses JSON into an inert SurrealQL [`Value`]
|
||||
#[instrument(name = "parser", skip_all, fields(length = input.len()))]
|
||||
pub fn json(input: &str) -> Result<Value, Error> {
|
||||
parse_impl(input, super::value::json)
|
||||
parse_impl(input.trim(), super::value::json)
|
||||
}
|
||||
|
||||
fn parse_impl<O>(input: &str, parser: impl Fn(&str) -> IResult<&str, O>) -> Result<O, Error> {
|
||||
|
|
Loading…
Reference in a new issue