Skip to content

Commit

Permalink
The example should output "Hello from Rust!" (#1931)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
fbitti authored and alexcrichton committed Jan 6, 2020
1 parent 1548953 commit aab99fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/import_js/crate/defined-in-js.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function name() {
return 'World';
return 'Rust';
}

export class MyClass {
Expand Down
2 changes: 1 addition & 1 deletion examples/import_js/crate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit aab99fe

Please sign in to comment.