aboutsummaryrefslogtreecommitdiff
path: root/src/utils/mod.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-12-16 13:24:09 -0800
committerZeyla Hellyer <[email protected]>2017-12-16 13:24:09 -0800
commit9b53582f5e5e9650abda4106124e7f9f4e78a90c (patch)
tree88bd56a75b1d110ea049abbaea88bb6e8a83dac3 /src/utils/mod.rs
parentFix compilation of examples (diff)
downloadserenity-9b53582f5e5e9650abda4106124e7f9f4e78a90c.tar.xz
serenity-9b53582f5e5e9650abda4106124e7f9f4e78a90c.zip
Fix most clippy lints, take more refeernces
Fix clippy lints and subsequently accept references for more function parameters.
Diffstat (limited to 'src/utils/mod.rs')
-rw-r--r--src/utils/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index 2660798..907d3a3 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -18,7 +18,7 @@ use model::misc::EmojiIdentifier;
use std::collections::HashMap;
use std::ffi::OsStr;
use std::fs::File;
-use std::hash::Hash;
+use std::hash::{BuildHasher, Hash};
use std::io::Read;
use std::path::Path;
@@ -28,11 +28,11 @@ use cache::Cache;
use CACHE;
/// Converts a HashMap into a final `serde_json::Map` representation.
-pub fn hashmap_to_json_map<T>(map: HashMap<T, Value>) -> Map<String, Value>
- where T: Eq + Hash + ToString {
+pub fn hashmap_to_json_map<H, T>(map: HashMap<T, Value, H>)
+ -> Map<String, Value> where H: BuildHasher, T: Eq + Hash + ToString {
let mut json_map = Map::new();
- for (key, value) in map.into_iter() {
+ for (key, value) in map {
json_map.insert(key.to_string(), value);
}