aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2017-06-01 21:15:32 -0700
committerZeyla Hellyer <[email protected]>2017-06-01 21:15:32 -0700
commit6579b1fb0409410f303a4df5e7246c507a80f27b (patch)
tree1f29ba75cac5f5e9527a759889d2308b893274d2 /tests
parentFix ratelimiting::ROUTES doctest (diff)
downloadserenity-6579b1fb0409410f303a4df5e7246c507a80f27b.tar.xz
serenity-6579b1fb0409410f303a4df5e7246c507a80f27b.zip
Deprecate *User::distinct, add *User::tag
`distinct`, although accurate, is an odd name for the method. Deprecate `distinct` on `CurrentUser` and `User` and rename them to `tag`. Additionally, optimize the creation of the resultant String by about 2x. Instead of using the `format!` macro, create a new String with a capacity of 37 and push the username, `'#'`, and write the discriminator in manually.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_user.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/test_user.rs b/tests/test_user.rs
index 790243e..494e66b 100644
--- a/tests/test_user.rs
+++ b/tests/test_user.rs
@@ -25,6 +25,8 @@ fn test_core() {
user.avatar = None;
assert!(user.avatar_url().is_none());
+
+ assert_eq!(user.tag(), "test#1432");
}
#[test]