Skip to content

Commit 1c44c73

Browse files
Merge branch 'main' into bot-rust-update
2 parents f3c0570 + 0d20617 commit 1c44c73

3 files changed

Lines changed: 22 additions & 20 deletions

File tree

Cargo.lock

Lines changed: 12 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/sputnik/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ junobuild-macros = { path = "../libs/macros" }
3737
junobuild-storage = { path = "../libs/storage" }
3838
junobuild-utils = { path = "../libs/utils" }
3939
ic-wasi-polyfill = "0.12.0"
40-
rquickjs = { version = "0.11.0", git = "https://github.com/DelSkayn/rquickjs", rev = "5dcebf0e1e4f242de4b98208c328bf69eb4ac1e6", features = [
41-
"macro",
42-
"futures"
43-
] }
40+
rquickjs = { version = "0.12.0", features = ["macro", "futures"] }
4441
anyhow = "1.0.79"
4542
itoa = { version = "1", default-features = false }
4643
ryu = { version = "1", default-features = false }

src/sputnik/src/js/runtime.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::js::apis::init_apis;
77
use crate::js::dev::script::declare_dev_script;
88
use crate::js::inner_utils::format_js_error;
99
use rquickjs::{
10-
async_with, AsyncContext, AsyncRuntime, CatchResultExt, Context, Ctx, Error as JsError, Runtime,
10+
AsyncContext, AsyncRuntime, CatchResultExt, Context, Ctx, Error as JsError, Runtime,
1111
};
1212

1313
pub trait RunAsyncJsFn<T = ()> {
@@ -24,16 +24,17 @@ where
2424
.await
2525
.map_err(|e| format_js_error(JUNO_SPUTNIK_ERROR_RUNTIME_ASYNC_CONTEXT, e))?;
2626

27-
let result = async_with!(ctx => |ctx|{
28-
init_apis(&ctx).map_err(|e| format_js_error(JUNO_SPUTNIK_ERROR_RUNTIME_API_INIT, e))?;
27+
let result = ctx
28+
.async_with(async |ctx| {
29+
init_apis(&ctx).map_err(|e| format_js_error(JUNO_SPUTNIK_ERROR_RUNTIME_API_INIT, e))?;
2930

30-
declare_dev_script(&ctx).map_err(|e| e.to_string())?;
31+
declare_dev_script(&ctx).map_err(|e| e.to_string())?;
3132

32-
let result = f.run(&ctx).await.catch(&ctx).map_err(|e| e.to_string())?;
33+
let result = f.run(&ctx).await.catch(&ctx).map_err(|e| e.to_string())?;
3334

34-
Ok::<T, String>(result)
35-
})
36-
.await?;
35+
Ok::<T, String>(result)
36+
})
37+
.await?;
3738

3839
rt.idle().await;
3940

0 commit comments

Comments
 (0)