aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-04-25 15:48:13 -0700
committerZeyla Hellyer <[email protected]>2017-04-25 15:48:13 -0700
commit0f41ffc811827fdd45e4e631884909e33fa8769e (patch)
tree40c6d5091097ee86ed72e9868f77350bdaed078a /src/client
parentFix decoding for `CurrentUser.discriminator` (diff)
downloadserenity-0f41ffc811827fdd45e4e631884909e33fa8769e.tar.xz
serenity-0f41ffc811827fdd45e4e631884909e33fa8769e.zip
Make `User.discriminator` a u16
Change the User struct's `discriminator` field to a u16 for performance. The User struct's `discriminator` field was previously a u16 but changed to a `String` for ease-of-use. Lately the library has been gearing more towards performance where possible while not sacrificing ergonomics _too much_ in most scenarios.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/error.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/client/error.rs b/src/client/error.rs
index 225f2d3..a3df57c 100644
--- a/src/client/error.rs
+++ b/src/client/error.rs
@@ -22,10 +22,8 @@ use ::model::{ChannelType, Permissions};
/// let mut client = Client::login(&token);
///
/// client.on_member_unban(|context, guild_id, user| {
-/// let discriminator = user.discriminator.parse::<u16>().unwrap();
-///
/// // If the user has an even discriminator, don't re-ban them.
-/// if discriminator % 2 == 0 {
+/// if user.discriminator % 2 == 0 {
/// return;
/// }
///