Skip to content

Commit

Permalink
fix: 1.79.0 lints (#40)
Browse files Browse the repository at this point in the history
Fix new lints errors found in 1.79.0
  • Loading branch information
aesterline authored Jun 17, 2024
1 parent ba52d2b commit 4e806f0
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,23 @@ Then you can evaluate an expression with JSON input like this:
use bumpalo::Bump;
use jsonata_rs::JsonAta;

fn main() {
// Create an arena for allocating values, this will go away in future except for advanced use cases
let arena = Bump::new();
// Create an arena for allocating values, this will go away in future except for advanced use cases
let arena = Bump::new();

// Provide some JSON input, this could be read from a file or come from the network
let input = "{ \"name\": \"world\" }";
// Provide some JSON input, this could be read from a file or come from the network
let input = "{ \"name\": \"world\" }";

// The JSONata expression to evaluate
let expr = "\"Hello, \" & name & \"!\"";
// The JSONata expression to evaluate
let expr = "\"Hello, \" & name & \"!\"";

// Parse the expression - this could fail
let jsonata = JsonAta::new(expr, &arena).unwrap();
// Parse the expression - this could fail
let jsonata = JsonAta::new(expr, &arena).unwrap();

// Evaluate the expression against the input - this could fail
let result = jsonata.evaluate(Some(input)).unwrap();
// Evaluate the expression against the input - this could fail
let result = jsonata.evaluate(Some(input)).unwrap();

// Serialize the result into JSON
println!("{}", result.serialize(false));
}
// Serialize the result into JSON
println!("{}", result.serialize(false));
```

There's also a basic CLI tool:
Expand Down

0 comments on commit 4e806f0

Please sign in to comment.