Skip to content

Commit 17515f7

Browse files
authored
Merge pull request #2367 from lann/remove-instance-pre-arcs
core: Remove unnecessary Arc from (Module)InstancePre
2 parents fd3d660 + 577147b commit 17515f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

crates/core/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mod store;
1515
pub mod wasi_2023_10_18;
1616
pub mod wasi_2023_11_10;
1717

18-
use std::{path::PathBuf, sync::Arc, time::Duration};
18+
use std::{path::PathBuf, time::Duration};
1919

2020
use anyhow::Result;
2121
use crossbeam_channel::Sender;
@@ -395,14 +395,14 @@ impl<T: OutboundWasiHttpHandler + Send + Sync> Engine<T> {
395395
/// Creates a new [`InstancePre`] for the given [`Component`].
396396
#[instrument(skip_all)]
397397
pub fn instantiate_pre(&self, component: &Component) -> Result<InstancePre<T>> {
398-
let inner = Arc::new(self.linker.instantiate_pre(component)?);
398+
let inner = self.linker.instantiate_pre(component)?;
399399
Ok(InstancePre { inner })
400400
}
401401

402402
/// Creates a new [`ModuleInstancePre`] for the given [`Module`].
403403
#[instrument(skip_all)]
404404
pub fn module_instantiate_pre(&self, module: &Module) -> Result<ModuleInstancePre<T>> {
405-
let inner = Arc::new(self.module_linker.instantiate_pre(module)?);
405+
let inner = self.module_linker.instantiate_pre(module)?;
406406
Ok(ModuleInstancePre { inner })
407407
}
408408

@@ -424,7 +424,7 @@ impl<T> AsRef<wasmtime::Engine> for Engine<T> {
424424
///
425425
/// See [`wasmtime::component::InstancePre`] for more information.
426426
pub struct InstancePre<T> {
427-
inner: Arc<wasmtime::component::InstancePre<Data<T>>>,
427+
inner: wasmtime::component::InstancePre<Data<T>>,
428428
}
429429

430430
impl<T: Send + Sync> InstancePre<T> {
@@ -453,7 +453,7 @@ impl<T> AsRef<wasmtime::component::InstancePre<Data<T>>> for InstancePre<T> {
453453
///
454454
/// See [`wasmtime::InstancePre`] for more information.
455455
pub struct ModuleInstancePre<T> {
456-
inner: Arc<wasmtime::InstancePre<Data<T>>>,
456+
inner: wasmtime::InstancePre<Data<T>>,
457457
}
458458

459459
impl<T: Send + Sync> ModuleInstancePre<T> {

0 commit comments

Comments
 (0)