0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2025-01-12 17:09:28 -05:00

Replace transmute in example with cast (#153)

This commit is contained in:
Ry Dahl 2019-12-30 15:54:24 -05:00 committed by GitHub
parent 38057132cc
commit b7fa3341cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@
//! code.to_rust_string_lossy(scope);
//! let mut script = v8::Script::compile(scope, context, code, None).unwrap();
//! let result = script.run(scope, context).unwrap();
//! let result: v8::Local<v8::String> = unsafe { std::mem::transmute_copy(&result) };
//! let result = unsafe { v8::Local::<v8::String>::cast(result) };
//! let str = result.to_rust_string_lossy(scope);
//! println!("{}", str);
//!