Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Use `TryClone` from the prelude (#12680)

Nick Fitzgerald0bc56e8b7e9b
diff --git a/crates/environ/src/gc.rs b/crates/environ/src/gc.rs
index 469396b896..20a02cc814 100644
--- a/crates/environ/src/gc.rs
+++ b/crates/environ/src/gc.rs
@@ -17,10 +17,7 @@ pub mod null;
use crate::{
WasmArrayType, WasmCompositeInnerType, WasmCompositeType, WasmExnType, WasmStorageType,
- WasmStructType, WasmValType,
- collections::{self, TryClone},
- error::OutOfMemory,
- prelude::*,
+ WasmStructType, WasmValType, collections, error::OutOfMemory, prelude::*,
};
use alloc::sync::Arc;
use core::alloc::Layout;
diff --git a/crates/environ/src/string_pool.rs b/crates/environ/src/string_pool.rs
index 60a59deeb8..b70b5a3877 100644
--- a/crates/environ/src/string_pool.rs
+++ b/crates/environ/src/string_pool.rs
@@ -6,7 +6,6 @@ use crate::{
prelude::*,
};
use core::{fmt, mem, num::NonZeroU32};
-use wasmtime_core::alloc::TryClone;
/// An interned string associated with a particular string in a `StringPool`.
///
diff --git a/crates/environ/src/types.rs b/crates/environ/src/types.rs
index 6537a1f267..066cc0cdc4 100644
--- a/crates/environ/src/types.rs
+++ b/crates/environ/src/types.rs
@@ -1,8 +1,5 @@
use crate::{
- PanicOnOom as _, Tunables, WasmResult,
- collections::{TryClone, TryCollect as _, TryCow, TryExtend},
- error::OutOfMemory,
- prelude::*,
+ PanicOnOom as _, Tunables, WasmResult, collections::TryCow, error::OutOfMemory, prelude::*,
wasm_unsupported,
};
use alloc::boxed::Box;
diff --git a/crates/wasmtime/src/runtime/component/types.rs b/crates/wasmtime/src/runtime/component/types.rs
index 9fbc562af2..a14cd16764 100644
--- a/crates/wasmtime/src/runtime/component/types.rs
+++ b/crates/wasmtime/src/runtime/component/types.rs
@@ -3,7 +3,7 @@
#[cfg(feature = "component-model-async")]
use crate::component::ComponentType;
use crate::component::matching::InstanceType;
-use crate::{Engine, ExternType, FuncType};
+use crate::{Engine, ExternType, FuncType, prelude::*};
use alloc::sync::Arc;
use core::fmt;
use core::ops::Deref;
@@ -14,7 +14,7 @@ use wasmtime_environ::component::{
TypeRecordIndex, TypeResourceTable, TypeResourceTableIndex, TypeResultIndex, TypeStreamIndex,
TypeStreamTableIndex, TypeTupleIndex, TypeVariantIndex,
};
-use wasmtime_environ::{PanicOnOom as _, PrimaryMap, collections::TryClone as _};
+use wasmtime_environ::{PanicOnOom as _, PrimaryMap};
pub use crate::component::resources::ResourceType;
diff --git a/crates/wasmtime/src/runtime/linker.rs b/crates/wasmtime/src/runtime/linker.rs
index 0c4fb71f3a..c47c41ac57 100644
--- a/crates/wasmtime/src/runtime/linker.rs
+++ b/crates/wasmtime/src/runtime/linker.rs
@@ -13,10 +13,7 @@ use core::future::Future;
use core::marker;
use core::mem::MaybeUninit;
use log::warn;
-use wasmtime_environ::{
- Atom, PanicOnOom as _, StringPool,
- collections::{HashMap, TryClone},
-};
+use wasmtime_environ::{Atom, PanicOnOom as _, StringPool, collections::HashMap};
/// Structure used to link wasm modules/instances together.
///
diff --git a/crates/wasmtime/src/runtime/type_registry.rs b/crates/wasmtime/src/runtime/type_registry.rs
index f006de80e7..5bb9127869 100644
--- a/crates/wasmtime/src/runtime/type_registry.rs
+++ b/crates/wasmtime/src/runtime/type_registry.rs
@@ -25,7 +25,7 @@ use wasmtime_core::slab::{Id as SlabId, Slab};
use wasmtime_environ::{
EngineOrModuleTypeIndex, EntityRef, GcLayout, ModuleInternedTypeIndex, ModuleTypes,
PanicOnOom as _, TypeTrace, Undo, VMSharedTypeIndex, WasmRecGroup, WasmSubType,
- collections::{HashSet, PrimaryMap, SecondaryMap, TryClone, TryCow, Vec},
+ collections::{HashSet, PrimaryMap, SecondaryMap, TryCow, Vec},
iter_entity_range,
packed_option::{PackedOption, ReservedValue},
};