From aab99feb3e1de666069c6157469b127bda193dd6 Mon Sep 17 00:00:00 2001 From: Fernando Bitti Loureiro Date: Mon, 6 Jan 2020 18:47:13 +0100 Subject: [PATCH] The example should output "Hello from Rust!" (#1931) * Make console output "Hello from Rust!" The HTML says the console would output Hello from Rust!, but instead it outputs Hello, World! This is a proposed fix. * Output "Hello from Rust!" The HTML says the console would output "Hello from Rust!" but instead it outputs "Hello, World!". This is a proposed fix. --- examples/import_js/crate/defined-in-js.js | 2 +- examples/import_js/crate/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/import_js/crate/defined-in-js.js b/examples/import_js/crate/defined-in-js.js index ed5091b02..8d1f0a454 100644 --- a/examples/import_js/crate/defined-in-js.js +++ b/examples/import_js/crate/defined-in-js.js @@ -1,5 +1,5 @@ export function name() { - return 'World'; + return 'Rust'; } export class MyClass { diff --git a/examples/import_js/crate/src/lib.rs b/examples/import_js/crate/src/lib.rs index 5f199007e..e6fdad899 100644 --- a/examples/import_js/crate/src/lib.rs +++ b/examples/import_js/crate/src/lib.rs @@ -26,7 +26,7 @@ extern "C" { #[wasm_bindgen(start)] pub fn run() { - log(&format!("Hello, {}!", name())); + log(&format!("Hello from {}!", name())); // should output "Hello from Rust!" let x = MyClass::new(); assert_eq!(x.number(), 42);