summaryrefslogtreecommitdiff
path: root/src/conversion.rs
diff options
context:
space:
mode:
authorkyren <kerriganw@gmail.com>2017-10-24 16:15:57 -0400
committerkyren <kerriganw@gmail.com>2017-10-24 16:15:57 -0400
commit773bf3e9ba38ccd2ecae595720a79a249dcc04de (patch)
tree553d82e5f6a94ace3771c0ee4b42c48a4c27c872 /src/conversion.rs
parent4bbeeb2b2d67a604aeae16594414f54fc1da1654 (diff)
downloadmlua-773bf3e9ba38ccd2ecae595720a79a249dcc04de.zip
Fix some clippy lints, possible edge case API incompatibility around HashMap
Diffstat (limited to 'src/conversion.rs')
-rw-r--r--src/conversion.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/conversion.rs b/src/conversion.rs
index 306249b..be19414 100644
--- a/src/conversion.rs
+++ b/src/conversion.rs
@@ -1,5 +1,5 @@
use std::collections::{BTreeMap, HashMap};
-use std::hash::Hash;
+use std::hash::{BuildHasher, Hash};
use std::string::String as StdString;
use error::*;
@@ -266,13 +266,15 @@ impl<'lua, T: FromLua<'lua>> FromLua<'lua> for Vec<T> {
}
}
-impl<'lua, K: Eq + Hash + ToLua<'lua>, V: ToLua<'lua>> ToLua<'lua> for HashMap<K, V> {
+impl<'lua, K: Eq + Hash + ToLua<'lua>, V: ToLua<'lua>, S: BuildHasher> ToLua<'lua>
+ for HashMap<K, V, S> {
fn to_lua(self, lua: &'lua Lua) -> Result<Value<'lua>> {
Ok(Value::Table(lua.create_table_from(self)?))
}
}
-impl<'lua, K: Eq + Hash + FromLua<'lua>, V: FromLua<'lua>> FromLua<'lua> for HashMap<K, V> {
+impl<'lua, K: Eq + Hash + FromLua<'lua>, V: FromLua<'lua>, S: BuildHasher + Default> FromLua<'lua>
+ for HashMap<K, V, S> {
fn from_lua(value: Value<'lua>, _: &'lua Lua) -> Result<Self> {
if let Value::Table(table) = value {
table.pairs().collect()