From 8fc1cfcb386271788479a973f1950ec00bb9e3d7 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Fri, 3 Dec 2021 16:31:58 +0800 Subject: [PATCH] feat(napi): TypeName and ToNapiValue should apply to any HashMap --- crates/napi/src/bindgen_runtime/js_values/map.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/napi/src/bindgen_runtime/js_values/map.rs b/crates/napi/src/bindgen_runtime/js_values/map.rs index f91e7c51..eb313e69 100644 --- a/crates/napi/src/bindgen_runtime/js_values/map.rs +++ b/crates/napi/src/bindgen_runtime/js_values/map.rs @@ -3,7 +3,7 @@ use std::hash::Hash; use crate::bindgen_prelude::{Env, Result, ToNapiValue, *}; -impl TypeName for HashMap { +impl TypeName for HashMap { fn type_name() -> &'static str { "HashMap" } @@ -13,7 +13,7 @@ impl TypeName for HashMap { } } -impl ToNapiValue for HashMap +impl ToNapiValue for HashMap where K: AsRef, V: ToNapiValue,