Update README.md
This commit is contained in:
parent
efb7b31487
commit
be3d360913
11
README.md
11
README.md
@ -49,16 +49,7 @@ fn main() {
|
|||||||
You can also evaluate a script file:
|
You can also evaluate a script file:
|
||||||
|
|
||||||
```Rust
|
```Rust
|
||||||
extern crate rhai;
|
if let Ok(result) = engine.eval_file::<i32>("hello_world.rhai") { ... }
|
||||||
use rhai::Engine;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
let mut engine = Engine::new();
|
|
||||||
|
|
||||||
if let Ok(result) = engine.eval_file::<i32>("hello_world.rhai") {
|
|
||||||
println!("Answer: {}", result); // prints 42
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# Working with functions
|
# Working with functions
|
||||||
|
Loading…
Reference in New Issue
Block a user