From ab1bc3fe821c9b66d4e348bf10ce3a096195bdba Mon Sep 17 00:00:00 2001 From: Austin Hellyer Date: Wed, 9 Nov 2016 20:37:22 -0800 Subject: Add a Feature enum Features are handed by Discord to guilds that meet requirements which are most likely realistically arbitrary. The 3 features at this moment are: - INVITE_SPLASH - VANITY_URL - VIP_REGIONS On decoding of the two guild structs, map these string values to enum variants. --- src/model/guild.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/model/guild.rs b/src/model/guild.rs index e8aff56..460f5ca 100644 --- a/src/model/guild.rs +++ b/src/model/guild.rs @@ -309,7 +309,7 @@ impl LiveGuild { channels: public_channels, default_message_notifications: req!(try!(remove(&mut map, "default_message_notifications")).as_u64()), emojis: try!(remove(&mut map, "emojis").and_then(decode_emojis)), - features: try!(remove(&mut map, "features").and_then(|v| decode_array(v, into_string))), + features: try!(remove(&mut map, "features").and_then(|v| decode_array(v, Feature::decode_str))), icon: try!(opt(&mut map, "icon", into_string)), id: id, joined_at: try!(remove(&mut map, "joined_at").and_then(into_string)), -- cgit v1.2.3