aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorLeah <[email protected]>2018-03-23 13:54:12 +0100
committeralex <[email protected]>2018-03-23 13:54:12 +0100
commitfdcf44e1463e708cd8b612c183e302db9af0febd (patch)
tree1a311f26fb38522ba380881fa6e72c0c2e5c54bc /src/utils
parentFix Create(Embed/Message) to be consistent (diff)
downloadserenity-fdcf44e1463e708cd8b612c183e302db9af0febd.tar.xz
serenity-fdcf44e1463e708cd8b612c183e302db9af0febd.zip
Change the way ids and some enums are made (#295)
This makes them easier to be found by tools like rls. Also update struct inits to use the shorthand version for `x: x`.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/mod.rs2
-rw-r--r--src/utils/vec_map.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/mod.rs b/src/utils/mod.rs
index de75632..5b98b7b 100644
--- a/src/utils/mod.rs
+++ b/src/utils/mod.rs
@@ -329,7 +329,7 @@ pub fn parse_emoji(mention: &str) -> Option<EmojiIdentifier> {
match id.parse::<u64>() {
Ok(x) => Some(EmojiIdentifier {
- name: name,
+ name,
id: EmojiId(x),
}),
_ => None,
diff --git a/src/utils/vec_map.rs b/src/utils/vec_map.rs
index 786bf14..70e65f5 100644
--- a/src/utils/vec_map.rs
+++ b/src/utils/vec_map.rs
@@ -29,11 +29,11 @@ impl<K: PartialEq, V> VecMap<K, V> {
match self.pos(&key) {
Some(pos) => Entry::Occupied(OccupiedEntry {
vec: &mut self.0,
- pos: pos,
+ pos,
}),
None => Entry::Vacant(VacantEntry {
vec: &mut self.0,
- key: key,
+ key,
})
}
}