Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
rscarson committed Jul 10, 2024
1 parent a29c1aa commit df70551
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/ext/webstorage/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use deno_core::{extension, Extension};
use std::path::PathBuf;

extension!(
init_webstorage,
deps = [rustyscript],
Expand Down
11 changes: 5 additions & 6 deletions src/snapshot_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ impl SnapshotBuilder {
let deno_runtime = &mut self.deno_runtime;
let tokio_runtime = self.tokio_runtime.clone();

InnerRuntime::run_async_task(
async move {
tokio_runtime.block_on(async move {
tokio::time::timeout(timeout, || async move {
let module_specifier = module.filename().to_module_specifier()?;
let (code, _) = transpiler::transpile(&module_specifier, module.contents())?;
let code = deno_core::FastString::from(code);
Expand All @@ -152,9 +152,8 @@ impl SnapshotBuilder {
.await?;
result.await?;
Ok::<ModuleId, Error>(modid)
},
timeout,
tokio_runtime,
)
})
.await
})?
}
}
4 changes: 2 additions & 2 deletions src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ where
/// Evaluate a string of non-ecma javascript code in a separate thread
/// The code is evaluated in a new runtime instance, which is then destroyed
/// Returns a handle to the thread that is running the code
pub fn eval_in_thread<T: 'static>(code: String) -> std::thread::JoinHandle<Result<T, Error>>
pub fn eval_in_thread<T>(code: String) -> std::thread::JoinHandle<Result<T, Error>>
where
T: serde::de::DeserializeOwned + Send,
T: serde::de::DeserializeOwned + Send + 'static,
{
deno_core::JsRuntime::init_platform(None);
std::thread::spawn(move || {
Expand Down

0 comments on commit df70551

Please sign in to comment.