diff --git a/boa_examples/src/bin/loadfile.rs b/boa_examples/src/bin/loadfile.rs index 595e863f7c2..b88fe490fc9 100644 --- a/boa_examples/src/bin/loadfile.rs +++ b/boa_examples/src/bin/loadfile.rs @@ -1,14 +1,14 @@ // This example shows how to load, parse and execute JS code from a source file // (./scripts/helloworld.js) -use std::fs::read_to_string; +use std::fs; use boa_engine::Context; fn main() { let js_file_path = "./scripts/helloworld.js"; - match read_to_string(js_file_path) { + match fs::read(js_file_path) { Ok(src) => { // Instantiate the execution context let mut context = Context::default();