From da12f6907bb6336c301ca3f72a93c3bece9f9262 Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 25 Feb 2021 13:51:01 +0100 Subject: [PATCH 1/2] feat(api) Remove useless code. --- lib/api/src/import_object.rs | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lib/api/src/import_object.rs b/lib/api/src/import_object.rs index b38f4aa8d2b..1d507baa7c9 100644 --- a/lib/api/src/import_object.rs +++ b/lib/api/src/import_object.rs @@ -145,20 +145,6 @@ impl IntoIterator for ImportObject { impl fmt::Debug for ImportObject { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - enum SecretOption { - None, - Some, - } - - impl fmt::Debug for SecretOption { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match self { - Self::None => write!(f, "None"), - Self::Some => write!(f, "Some(...)"), - } - } - } - enum SecretMap { Empty, Some(usize), From a5347fe7596b72346d95f0f51bfe6a36f0c2dc1f Mon Sep 17 00:00:00 2001 From: Ivan Enderlin Date: Thu, 25 Feb 2021 13:51:14 +0100 Subject: [PATCH 2/2] feat(types) Avoid allocating a `Vec` when calling `FunctionType::new`. --- lib/wasmer-types/src/types.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/wasmer-types/src/types.rs b/lib/wasmer-types/src/types.rs index 6ed80e73ce5..6a9b9b9ab4d 100644 --- a/lib/wasmer-types/src/types.rs +++ b/lib/wasmer-types/src/types.rs @@ -238,12 +238,12 @@ impl FunctionType { /// Creates a new Function Type with the given parameter and return types. pub fn new(params: Params, returns: Returns) -> Self where - Params: Into>, - Returns: Into>, + Params: Into>, + Returns: Into>, { Self { - params: params.into().into_boxed_slice(), - results: returns.into().into_boxed_slice(), + params: params.into(), + results: returns.into(), } }