Description
Splitting at "", also produces the "" at the start and last, which should not be produced. split ("72", "") -> Actual (["","7","2",""] ), Expected is ["7","2"]
Steps to Reproduce
- The following code to be included in the main.rs
use jslt::Jslt;
use serde_json::json;
use std::fs;
fn main() -> Result<(), Box <dyn std::error::Error> > {
let jslt: Jslt = r#"
[split("17",""),split("17","1")]
"#.parse()?;
let input = json!({
"data": [
[1, 2, 3, 4, 5],
[6, 7, 8, 9, 10]
]
});
let output = jslt.transform_value(&input)?;
println!("{}",output);
assert_eq!("[[\"1\",\"7\"],[\"\",\"7\"]]",output.to_string());
Ok(())
}
Actual Output
[["","1","7",""],["","7"]]
Expected Output
[[ "1", "7" ],["","7"]]
Environment
Nightly Rust Toolchain
Description
Splitting at "", also produces the "" at the start and last, which should not be produced. split ("72", "") -> Actual (["","7","2",""] ), Expected is ["7","2"]
Steps to Reproduce
use jslt::Jslt; use serde_json::json; use std::fs; fn main() -> Result<(), Box <dyn std::error::Error> > { let jslt: Jslt = r#" [split("17",""),split("17","1")] "#.parse()?; let input = json!({ "data": [ [1, 2, 3, 4, 5], [6, 7, 8, 9, 10] ] }); let output = jslt.transform_value(&input)?; println!("{}",output); assert_eq!("[[\"1\",\"7\"],[\"\",\"7\"]]",output.to_string()); Ok(()) }Actual Output
[["","1","7",""],["","7"]]
Expected Output
[[ "1", "7" ],["","7"]]
Environment
Nightly Rust Toolchain