We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0b6d80f commit 197c2b1Copy full SHA for 197c2b1
wasm/src/lib.rs
@@ -13,11 +13,11 @@ extern "C" {
13
pub fn alert(s: &str);
14
}
15
16
-pub fn create_snapshot(code: &str) -> SnapshotConfig {
+pub fn create_snapshot(code: &str, language: String) -> SnapshotConfig {
17
let code_content = Content::Code(
18
CodeBuilder::default()
19
.content(code)
20
- .language("rust")
+ .language(language)
21
.build()
22
.unwrap(),
23
);
@@ -50,10 +50,10 @@ impl Snapshot {
50
51
52
#[wasm_bindgen]
53
-pub fn take_snapshot(code: &str) -> Snapshot {
+pub fn take_snapshot(code: &str, language: String) -> Snapshot {
54
console_error_panic_hook::set_once();
55
56
- let config = create_snapshot(code);
+ let config = create_snapshot(code, language);
57
58
Snapshot::new(config)
59
0 commit comments