feat(napi): TypeName and ToNapiValue should apply to any HashMap

This commit is contained in:
LongYinan 2021-12-03 16:31:58 +08:00
parent 53fe4d3aa5
commit 8fc1cfcb38
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -3,7 +3,7 @@ use std::hash::Hash;
use crate::bindgen_prelude::{Env, Result, ToNapiValue, *};
impl<K, V> TypeName for HashMap<K, V> {
impl<K, V, S> TypeName for HashMap<K, V, S> {
fn type_name() -> &'static str {
"HashMap"
}
@ -13,7 +13,7 @@ impl<K, V> TypeName for HashMap<K, V> {
}
}
impl<K, V> ToNapiValue for HashMap<K, V>
impl<K, V, S> ToNapiValue for HashMap<K, V, S>
where
K: AsRef<str>,
V: ToNapiValue,