Skip to content

Commit aab99fe

Browse files
fbittialexcrichton
authored andcommitted
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.
1 parent 1548953 commit aab99fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/import_js/crate/defined-in-js.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export function name() {
2-
return 'World';
2+
return 'Rust';
33
}
44

55
export class MyClass {

examples/import_js/crate/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extern "C" {
2626

2727
#[wasm_bindgen(start)]
2828
pub fn run() {
29-
log(&format!("Hello, {}!", name()));
29+
log(&format!("Hello from {}!", name())); // should output "Hello from Rust!"
3030

3131
let x = MyClass::new();
3232
assert_eq!(x.number(), 42);

0 commit comments

Comments
 (0)