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.
This commit is contained in:
Fernando Bitti Loureiro 2020-01-06 18:47:13 +01:00 committed by Alex Crichton
parent 1548953364
commit aab99feb3e
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
export function name() {
return 'World';
return 'Rust';
}
export class MyClass {

View File

@ -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);