0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2025-01-13 01:22:42 -05:00

Remove mut from Example in lib.rs (#523)

This commit removes mut from the script variable to avoid the following
warning if used:

25 |   let mut script = v8::Script::compile(scope, code, None).unwrap();
   |       ----^^^^^^
   |       |
   |       help: remove this `mut`
   |
   = note: `#[warn(unused_mut)]` on by default

warning: 1 warning emitted
This commit is contained in:
Daniel Bevenius 2020-11-13 21:55:52 +01:00 committed by GitHub
parent 0f772d7a31
commit 0e54213cc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@
//! let code = v8::String::new(scope, "'Hello' + ' World!'").unwrap();
//! println!("javascript code: {}", code.to_rust_string_lossy(scope));
//!
//! let mut script = v8::Script::compile(scope, code, None).unwrap();
//! let script = v8::Script::compile(scope, code, None).unwrap();
//! let result = script.run(scope).unwrap();
//! let result = result.to_string(scope).unwrap();
//! println!("result: {}", result.to_rust_string_lossy(scope));