Skip to content

Commit cb27d4c

Browse files
author
22388o
committed
Fix lib
1 parent af082f3 commit cb27d4c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,21 @@ use wasm_bindgen::prelude::*;
44
// Import the console logging functionality from the web_sys crate
55
use web_sys::console;
66

7+
78
#[wasm_bindgen]
89
pub fn greet(name: &str) -> String {
9-
format!("DLC, {}!", name)
10+
// Ensure the string is formatted correctly.
11+
format!("Hello, {}!", name)
1012
}
1113

1214
#[wasm_bindgen]
1315
pub fn log(msg: &str) {
16+
// Safely log the message to the browser's console.
1417
console::log_1(&msg.into());
1518
}
1619

1720
#[wasm_bindgen]
1821
pub fn add(a: i32, b: i32) -> i32 {
22+
// Return the sum of the two integers.
1923
a + b
20-
}
24+
}

0 commit comments

Comments
 (0)